From efa32092ab5cf02dbc5abc76f2d3ec2c715ad46b Mon Sep 17 00:00:00 2001 From: amirroth Date: Mon, 31 Jul 2023 10:43:30 -0400 Subject: [PATCH 01/50] Initial PollutionModule cleanup --- src/EnergyPlus/Data/EnergyPlusData.cc | 4 +- src/EnergyPlus/Data/EnergyPlusData.hh | 4 +- src/EnergyPlus/HVACManager.cc | 2 +- src/EnergyPlus/OutputProcessor.cc | 2 +- src/EnergyPlus/OutputProcessor.hh | 2 +- src/EnergyPlus/OutputReportTabular.cc | 4 +- src/EnergyPlus/PollutionModule.cc | 6582 +---------------- src/EnergyPlus/PollutionModule.hh | 1673 +---- src/EnergyPlus/SimulationManager.cc | 6 +- .../unit/OutputReportTabular.unit.cc | 2 +- tst/EnergyPlus/unit/PollutionModule.unit.cc | 61 +- 11 files changed, 662 insertions(+), 7680 deletions(-) diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index b6402a9df35..e929ae2323c 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -213,7 +213,7 @@ EnergyPlusData::EnergyPlusData() this->dataPlantValves = std::make_unique(); this->dataPlnt = std::make_unique(); this->dataPluginManager = std::make_unique(); - this->dataPollutionModule = std::make_unique(); + this->dataPollution = std::make_unique(); this->dataPondGHE = std::make_unique(); this->dataPowerInductionUnits = std::make_unique(); this->dataPsychrometrics = std::make_unique(); @@ -469,7 +469,7 @@ void EnergyPlusData::clear_state() this->dataPlantValves->clear_state(); this->dataPlnt->clear_state(); this->dataPluginManager->clear_state(); - this->dataPollutionModule->clear_state(); + this->dataPollution->clear_state(); this->dataPondGHE->clear_state(); this->dataPowerInductionUnits->clear_state(); this->dataPsychrometrics->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index b13040e86fe..caaf04a9b85 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -228,7 +228,7 @@ struct PlantPressureSysData; struct PlantUtilitiesData; struct PlantValvesData; struct PluginManagerData; -struct PollutionModuleData; +struct PollutionData; struct PondGroundHeatExchangerData; struct PoweredInductionUnitsData; struct PsychrometricsData; @@ -485,7 +485,7 @@ struct EnergyPlusData : BaseGlobalStruct std::unique_ptr dataPlantUtilities; std::unique_ptr dataPlantValves; std::unique_ptr dataPluginManager; - std::unique_ptr dataPollutionModule; + std::unique_ptr dataPollution; std::unique_ptr dataPondGHE; std::unique_ptr dataPowerInductionUnits; std::unique_ptr dataPsychrometrics; diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index b6a6c6d75b5..702b3a96b92 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -434,7 +434,7 @@ void ManageHVAC(EnergyPlusData &state) if (!state.dataGlobal->WarmupFlag) { if (state.dataGlobal->DoOutputReporting && !state.dataGlobal->ZoneSizingCalc) { NodeInputManager::CalcMoreNodeInfo(state); - PollutionModule::CalculatePollution(state); + Pollution::CalculatePollution(state); SystemReports::InitEnergyReports(state); SystemReports::ReportSystemEnergyUse(state); } diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 0af70d89a6e..df71eb718bf 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -6169,7 +6169,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, } } -int GetMeterIndex(EnergyPlusData &state, std::string const &MeterName) +int GetMeterIndex(EnergyPlusData &state, std::string_view const MeterName) { // FUNCTION INFORMATION: diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index ba32aed671c..024c4b471c6 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -889,7 +889,7 @@ void SetInitialMeterReportingAndOutputNames(EnergyPlusData &state, bool CumulativeIndicator // true if this is a Cumulative meter reporting ); -int GetMeterIndex(EnergyPlusData &state, std::string const &MeterName); +int GetMeterIndex(EnergyPlusData &state, std::string_view const MeterName); std::string GetMeterResourceType(EnergyPlusData &state, int MeterNumber); // Which Meter Number (from GetMeterIndex) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 78798f7a909..692b011879f 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -2820,8 +2820,8 @@ void GetInputFuelAndPollutionFactors(EnergyPlusData &state) // na // Using/Aliasing - using PollutionModule::GetEnvironmentalImpactFactorInfo; - using PollutionModule::GetFuelFactorInfo; + using Pollution::GetEnvironmentalImpactFactorInfo; + using Pollution::GetFuelFactorInfo; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index aa2d8b65696..56940649a7e 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -59,7 +59,7 @@ #include #include -namespace EnergyPlus::PollutionModule { +namespace EnergyPlus::Pollution { // Module containing the pollution calculation routines // MODULE INFORMATION: @@ -110,7 +110,7 @@ void CalculatePollution(EnergyPlusData &state) // METHODOLOGY EMPLOYED: // Uses the status flags to trigger events. - if (!state.dataPollutionModule->PollutionReportSetup) return; + if (!state.dataPollution->PollutionReportSetup) return; // Call the Routine to Read the Energy Values from the EnergyPlus Meters ReadEnergyMeters(state); @@ -152,7 +152,7 @@ void SetupPollutionCalculations(EnergyPlusData &state) // First determine if the Pollution reporting has been triggered, and is not exit. cCurrentModuleObject = "Output:EnvironmentalImpactFactors"; NumPolluteRpt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - state.dataPollutionModule->PollutionReportSetup = true; + state.dataPollution->PollutionReportSetup = true; for (Loop = 1; Loop <= NumPolluteRpt; ++Loop) { @@ -186,1983 +186,214 @@ void GetPollutionFactorInput(EnergyPlusData &state) // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN August 2008 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // SetupPollutionCalculation must be called after meters are initialized. This caused a problem // in runs so have added this routine to allow central get for most inputs. - // Using/Aliasing + constexpr std::string_view routineName = "GetPollutionFactorInput"; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; int NumNums; - int Loop; int IOStat; - bool ErrorsFound(false); - auto &Pollution = state.dataPollutionModule->Pollution; - auto &FuelType = state.dataPollutionModule->FuelType; - if (!state.dataPollutionModule->GetInputFlagPollution) return; // Input already gotten - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; - state.dataPollutionModule->GetInputFlagPollution = false; + bool ErrorsFound = false; - cCurrentModuleObject = "EnvironmentalImpactFactors"; - state.dataPollutionModule->NumEnvImpactFactors = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - if (state.dataPollutionModule->NumEnvImpactFactors > 0) { - // Now find and load all of the user inputs and factors. - state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, - 1, - state.dataIPShortCut->cAlphaArgs, - NumAlphas, - state.dataIPShortCut->rNumericArgs, - NumNums, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - } else { - if (state.dataPollutionModule->PollutionReportSetup) - ShowWarningError(state, format("{}: not entered. Values will be defaulted.", cCurrentModuleObject)); - } + auto &ip = state.dataInputProcessing->inputProcessor; + auto &ipsc = state.dataIPShortCut; + auto &pm = state.dataPollution; + + if (!pm->GetInputFlagPollution) return; // Input already gotten + pm->GetInputFlagPollution = false; - Pollution.PurchHeatEffic = 0.3; - Pollution.PurchCoolCOP = 3.0; - Pollution.SteamConvEffic = 0.25; - Pollution.CarbonEquivN2O = 0.0; - Pollution.CarbonEquivCH4 = 0.0; - Pollution.CarbonEquivCO2 = 0.0; + ipsc->cCurrentModuleObject = "EnvironmentalImpactFactors"; + pm->NumEnvImpactFactors = ip->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataPollutionModule->NumEnvImpactFactors > 0) { + if (pm->NumEnvImpactFactors > 0) { + // Now find and load all of the user inputs and factors. + ip->getObjectItem(state, + ipsc->cCurrentModuleObject, + 1, + ipsc->cAlphaArgs, + NumAlphas, + ipsc->rNumericArgs, + NumNums, + IOStat, + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + } else if (pm->PollutionReportSetup) { + ShowWarningError(state, format("{}: not entered. Values will be defaulted.", ipsc->cCurrentModuleObject)); + } + + pm->PurchHeatEffic = 0.3; + pm->PurchCoolCOP = 3.0; + pm->SteamConvEffic = 0.25; + pm->CarbonEquivN2O = 0.0; + pm->CarbonEquivCH4 = 0.0; + pm->CarbonEquivCO2 = 0.0; + + if (pm->NumEnvImpactFactors > 0) { // If Heating Efficiency defined by the User is negative or zero then a default of 30% will be assigned. - if (state.dataIPShortCut->rNumericArgs(1) > 0.0) { - Pollution.PurchHeatEffic = state.dataIPShortCut->rNumericArgs(1); + if (ipsc->rNumericArgs(1) > 0.0) { + pm->PurchHeatEffic = ipsc->rNumericArgs(1); } // If COP defined by the User is negative or zero then a default of 3.0 will be assigned. - if (state.dataIPShortCut->rNumericArgs(2) > 0.0) { - Pollution.PurchCoolCOP = state.dataIPShortCut->rNumericArgs(2); + if (ipsc->rNumericArgs(2) > 0.0) { + pm->PurchCoolCOP = ipsc->rNumericArgs(2); } // If Steam Conversion Efficiency defined by the User is negative or zero then a default of 25% will be assigned. - if (state.dataIPShortCut->rNumericArgs(3) > 0.0) { - Pollution.SteamConvEffic = state.dataIPShortCut->rNumericArgs(3); + if (ipsc->rNumericArgs(3) > 0.0) { + pm->SteamConvEffic = ipsc->rNumericArgs(3); } // Load the Total Carbon Equivalent Pollution Factor coefficients - Pollution.CarbonEquivN2O = state.dataIPShortCut->rNumericArgs(4); - Pollution.CarbonEquivCH4 = state.dataIPShortCut->rNumericArgs(5); - Pollution.CarbonEquivCO2 = state.dataIPShortCut->rNumericArgs(6); + pm->CarbonEquivN2O = ipsc->rNumericArgs(4); + pm->CarbonEquivCH4 = ipsc->rNumericArgs(5); + pm->CarbonEquivCO2 = ipsc->rNumericArgs(6); } // Compare all of the Fuel Factors and compare to PollutionCalculationFactors List - cCurrentModuleObject = "FuelFactors"; - state.dataPollutionModule->NumFuelFactors = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + ipsc->cCurrentModuleObject = "FuelFactors"; + pm->NumFuelFactors = ip->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - for (Loop = 1; Loop <= state.dataPollutionModule->NumFuelFactors; ++Loop) { + for (int Loop = 1; Loop <= state.dataPollution->NumFuelFactors; ++Loop) { // Now find and load all of the user inputs and factors. - state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, - Loop, - state.dataIPShortCut->cAlphaArgs, - NumAlphas, - state.dataIPShortCut->rNumericArgs, - NumNums, - IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - FuelType.FuelTypeNames(Loop) = - static_cast(getEnumValue(Constant::eFuelNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); - - switch (FuelType.FuelTypeNames(Loop)) { - case Constant::eFuel::NaturalGas: { - if (Pollution.NatGasCoef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.NatGasCoef.FuelFactorUsed = true; - // Natural Gas Coeffs - Pollution.NatGasCoef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.NatGasCoef.SourceSched, - ErrorsFound); - } - Pollution.NatGasCoef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.NatGasCoef.CO2Sched, - ErrorsFound); - } - Pollution.NatGasCoef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.NatGasCoef.COSched, - ErrorsFound); - } - Pollution.NatGasCoef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.NatGasCoef.CH4Sched, - ErrorsFound); - } - Pollution.NatGasCoef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.NatGasCoef.NOxSched, - ErrorsFound); - } - Pollution.NatGasCoef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.NatGasCoef.N2OSched, - ErrorsFound); - } - Pollution.NatGasCoef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.NatGasCoef.SO2Sched, - ErrorsFound); - } - Pollution.NatGasCoef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.NatGasCoef.PMSched, - ErrorsFound); - } - Pollution.NatGasCoef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.NatGasCoef.PM10Sched, - ErrorsFound); - } - Pollution.NatGasCoef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.NatGasCoef.PM25Sched, - ErrorsFound); - } - Pollution.NatGasCoef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.NatGasCoef.NH3Sched, - ErrorsFound); - } - Pollution.NatGasCoef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.NatGasCoef.NMVOCSched, - ErrorsFound); - } - Pollution.NatGasCoef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.NatGasCoef.HgSched, - ErrorsFound); - } - Pollution.NatGasCoef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.NatGasCoef.PbSched, - ErrorsFound); - } - Pollution.NatGasCoef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.NatGasCoef.WaterSched, - ErrorsFound); - } - Pollution.NatGasCoef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.NatGasCoef.NucHiSched, - ErrorsFound); - } - Pollution.NatGasCoef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "NaturalGas", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.NatGasCoef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::FuelOilNo2: { - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.FuelOil2Coef.FuelFactorUsed = true; - // FuelOilNo2 Coeffs - Pollution.FuelOil2Coef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.FuelOil2Coef.SourceSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.FuelOil2Coef.CO2Sched, - ErrorsFound); - } - Pollution.FuelOil2Coef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.FuelOil2Coef.COSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.FuelOil2Coef.CH4Sched, - ErrorsFound); - } - Pollution.FuelOil2Coef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.FuelOil2Coef.NOxSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.FuelOil2Coef.N2OSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.FuelOil2Coef.SO2Sched, - ErrorsFound); - } - Pollution.FuelOil2Coef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.FuelOil2Coef.PMSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.FuelOil2Coef.PM10Sched, - ErrorsFound); - } - Pollution.FuelOil2Coef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.FuelOil2Coef.PM25Sched, - ErrorsFound); - } - Pollution.FuelOil2Coef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.FuelOil2Coef.NH3Sched, - ErrorsFound); - } - Pollution.FuelOil2Coef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.FuelOil2Coef.NMVOCSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.FuelOil2Coef.HgSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.FuelOil2Coef.PbSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.FuelOil2Coef.WaterSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.FuelOil2Coef.NucHiSched, - ErrorsFound); - } - Pollution.FuelOil2Coef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#2", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.FuelOil2Coef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::FuelOilNo1: { - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.FuelOil1Coef.FuelFactorUsed = true; - // FuelOilNo1 Coeffs - Pollution.FuelOil1Coef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.FuelOil1Coef.SourceSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.FuelOil1Coef.CO2Sched, - ErrorsFound); - } - Pollution.FuelOil1Coef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.FuelOil1Coef.COSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.FuelOil1Coef.CH4Sched, - ErrorsFound); - } - Pollution.FuelOil1Coef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.FuelOil1Coef.NOxSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.FuelOil1Coef.N2OSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.FuelOil1Coef.SO2Sched, - ErrorsFound); - } - Pollution.FuelOil1Coef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.FuelOil1Coef.PMSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.FuelOil1Coef.PM10Sched, - ErrorsFound); - } - Pollution.FuelOil1Coef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.FuelOil1Coef.PM25Sched, - ErrorsFound); - } - Pollution.FuelOil1Coef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.FuelOil1Coef.NH3Sched, - ErrorsFound); - } - Pollution.FuelOil1Coef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.FuelOil1Coef.NMVOCSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.FuelOil1Coef.HgSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.FuelOil1Coef.PbSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.FuelOil1Coef.WaterSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.FuelOil1Coef.NucHiSched, - ErrorsFound); - } - Pollution.FuelOil1Coef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Fuel Oil#1", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.FuelOil1Coef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::Coal: { - if (Pollution.CoalCoef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.CoalCoef.FuelFactorUsed = true; - // Coal - Pollution.CoalCoef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.CoalCoef.SourceSched, - ErrorsFound); - } - Pollution.CoalCoef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.CoalCoef.CO2Sched, - ErrorsFound); - } - Pollution.CoalCoef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.CoalCoef.COSched, - ErrorsFound); - } - Pollution.CoalCoef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.CoalCoef.CH4Sched, - ErrorsFound); - } - Pollution.CoalCoef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.CoalCoef.NOxSched, - ErrorsFound); - } - Pollution.CoalCoef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.CoalCoef.N2OSched, - ErrorsFound); - } - Pollution.CoalCoef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.CoalCoef.SO2Sched, - ErrorsFound); - } - Pollution.CoalCoef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.CoalCoef.PMSched, - ErrorsFound); - } - Pollution.CoalCoef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.CoalCoef.PM10Sched, - ErrorsFound); - } - Pollution.CoalCoef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.CoalCoef.PM25Sched, - ErrorsFound); - } - Pollution.CoalCoef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.CoalCoef.NH3Sched, - ErrorsFound); - } - Pollution.CoalCoef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.CoalCoef.NMVOCSched, - ErrorsFound); - } - Pollution.CoalCoef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.CoalCoef.HgSched, - ErrorsFound); - } - Pollution.CoalCoef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.CoalCoef.PbSched, - ErrorsFound); - } - Pollution.CoalCoef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.CoalCoef.WaterSched, - ErrorsFound); - } - Pollution.CoalCoef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.CoalCoef.NucHiSched, - ErrorsFound); - } - Pollution.CoalCoef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Coal", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.CoalCoef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::Electricity: { - if (Pollution.ElecCoef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.ElecCoef.FuelFactorUsed = true; - // Electric Coeffs - Pollution.ElecCoef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.ElecCoef.SourceSched, - ErrorsFound); - } - Pollution.ElecCoef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.ElecCoef.CO2Sched, - ErrorsFound); - } - Pollution.ElecCoef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.ElecCoef.COSched, - ErrorsFound); - } - Pollution.ElecCoef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.ElecCoef.CH4Sched, - ErrorsFound); - } - Pollution.ElecCoef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.ElecCoef.NOxSched, - ErrorsFound); - } - Pollution.ElecCoef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.ElecCoef.N2OSched, - ErrorsFound); - } - Pollution.ElecCoef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.ElecCoef.SO2Sched, - ErrorsFound); - } - Pollution.ElecCoef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.ElecCoef.PMSched, - ErrorsFound); - } - Pollution.ElecCoef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.ElecCoef.PM10Sched, - ErrorsFound); - } - Pollution.ElecCoef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.ElecCoef.PM25Sched, - ErrorsFound); - } - Pollution.ElecCoef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.ElecCoef.NH3Sched, - ErrorsFound); - } - Pollution.ElecCoef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.ElecCoef.NMVOCSched, - ErrorsFound); - } - Pollution.ElecCoef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.ElecCoef.HgSched, - ErrorsFound); - } - Pollution.ElecCoef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.ElecCoef.PbSched, - ErrorsFound); - } - Pollution.ElecCoef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.ElecCoef.WaterSched, - ErrorsFound); - } - Pollution.ElecCoef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.ElecCoef.NucHiSched, - ErrorsFound); - } - Pollution.ElecCoef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Electricity", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.ElecCoef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::Gasoline: { - if (Pollution.GasolineCoef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.GasolineCoef.FuelFactorUsed = true; - // Gasoline Coeffs - Pollution.GasolineCoef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.GasolineCoef.SourceSched, - ErrorsFound); - } - Pollution.GasolineCoef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.GasolineCoef.CO2Sched, - ErrorsFound); - } - Pollution.GasolineCoef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.GasolineCoef.COSched, - ErrorsFound); - } - Pollution.GasolineCoef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.GasolineCoef.CH4Sched, - ErrorsFound); - } - Pollution.GasolineCoef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.GasolineCoef.NOxSched, - ErrorsFound); - } - Pollution.GasolineCoef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.GasolineCoef.N2OSched, - ErrorsFound); - } - Pollution.GasolineCoef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.GasolineCoef.SO2Sched, - ErrorsFound); - } - Pollution.GasolineCoef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.GasolineCoef.PMSched, - ErrorsFound); - } - Pollution.GasolineCoef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.GasolineCoef.PM10Sched, - ErrorsFound); - } - Pollution.GasolineCoef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.GasolineCoef.PM25Sched, - ErrorsFound); - } - Pollution.GasolineCoef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.GasolineCoef.NH3Sched, - ErrorsFound); - } - Pollution.GasolineCoef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.GasolineCoef.NMVOCSched, - ErrorsFound); - } - Pollution.GasolineCoef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.GasolineCoef.HgSched, - ErrorsFound); - } - Pollution.GasolineCoef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.GasolineCoef.PbSched, - ErrorsFound); - } - Pollution.GasolineCoef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.GasolineCoef.WaterSched, - ErrorsFound); - } - Pollution.GasolineCoef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.GasolineCoef.NucHiSched, - ErrorsFound); - } - Pollution.GasolineCoef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Gasoline", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.GasolineCoef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::Propane: { - if (Pollution.PropaneCoef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.PropaneCoef.FuelFactorUsed = true; - // Propane Coeffs - Pollution.PropaneCoef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.PropaneCoef.SourceSched, - ErrorsFound); - } - Pollution.PropaneCoef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.PropaneCoef.CO2Sched, - ErrorsFound); - } - Pollution.PropaneCoef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.PropaneCoef.COSched, - ErrorsFound); - } - Pollution.PropaneCoef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.PropaneCoef.CH4Sched, - ErrorsFound); - } - Pollution.PropaneCoef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.PropaneCoef.NOxSched, - ErrorsFound); - } - Pollution.PropaneCoef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.PropaneCoef.N2OSched, - ErrorsFound); - } - Pollution.PropaneCoef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.PropaneCoef.SO2Sched, - ErrorsFound); - } - Pollution.PropaneCoef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.PropaneCoef.PMSched, - ErrorsFound); - } - Pollution.PropaneCoef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.PropaneCoef.PM10Sched, - ErrorsFound); - } - Pollution.PropaneCoef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.PropaneCoef.PM25Sched, - ErrorsFound); - } - Pollution.PropaneCoef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.PropaneCoef.NH3Sched, - ErrorsFound); - } - Pollution.PropaneCoef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.PropaneCoef.NMVOCSched, - ErrorsFound); - } - Pollution.PropaneCoef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.PropaneCoef.HgSched, - ErrorsFound); - } - Pollution.PropaneCoef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.PropaneCoef.PbSched, - ErrorsFound); - } - Pollution.PropaneCoef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.PropaneCoef.WaterSched, - ErrorsFound); - } - Pollution.PropaneCoef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.PropaneCoef.NucHiSched, - ErrorsFound); - } - Pollution.PropaneCoef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Propane", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.PropaneCoef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::Diesel: { - if (Pollution.DieselCoef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", - cCurrentModuleObject, - Constant::eFuelNames[static_cast(FuelType.FuelTypeNames(Loop))])); - continue; - } - Pollution.DieselCoef.FuelFactorUsed = true; - // Diesel Coeffs - Pollution.DieselCoef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.DieselCoef.SourceSched, - ErrorsFound); - } - Pollution.DieselCoef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.DieselCoef.CO2Sched, - ErrorsFound); - } - Pollution.DieselCoef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.DieselCoef.COSched, - ErrorsFound); - } - Pollution.DieselCoef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.DieselCoef.CH4Sched, - ErrorsFound); - } - Pollution.DieselCoef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.DieselCoef.NOxSched, - ErrorsFound); - } - Pollution.DieselCoef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.DieselCoef.N2OSched, - ErrorsFound); - } - Pollution.DieselCoef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.DieselCoef.SO2Sched, - ErrorsFound); - } - Pollution.DieselCoef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.DieselCoef.PMSched, - ErrorsFound); - } - Pollution.DieselCoef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.DieselCoef.PM10Sched, - ErrorsFound); - } - Pollution.DieselCoef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.DieselCoef.PM25Sched, - ErrorsFound); - } - Pollution.DieselCoef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.DieselCoef.NH3Sched, - ErrorsFound); - } - Pollution.DieselCoef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.DieselCoef.NMVOCSched, - ErrorsFound); - } - Pollution.DieselCoef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.DieselCoef.HgSched, - ErrorsFound); - } - Pollution.DieselCoef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.DieselCoef.PbSched, - ErrorsFound); - } - Pollution.DieselCoef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.DieselCoef.WaterSched, - ErrorsFound); - } - Pollution.DieselCoef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.DieselCoef.NucHiSched, - ErrorsFound); - } - Pollution.DieselCoef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "Diesel", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.DieselCoef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::OtherFuel1: { - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", cCurrentModuleObject, FuelType.FuelTypeNames(Loop))); - continue; - } - Pollution.OtherFuel1Coef.FuelFactorUsed = true; - // OtherFuel1 Coeffs - Pollution.OtherFuel1Coef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.OtherFuel1Coef.SourceSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.OtherFuel1Coef.CO2Sched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.OtherFuel1Coef.COSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.OtherFuel1Coef.CH4Sched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.OtherFuel1Coef.NOxSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.OtherFuel1Coef.N2OSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.OtherFuel1Coef.SO2Sched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.OtherFuel1Coef.PMSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.OtherFuel1Coef.PM10Sched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.OtherFuel1Coef.PM25Sched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.OtherFuel1Coef.NH3Sched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.OtherFuel1Coef.NMVOCSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.OtherFuel1Coef.HgSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.OtherFuel1Coef.PbSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.OtherFuel1Coef.WaterSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.OtherFuel1Coef.NucHiSched, - ErrorsFound); - } - Pollution.OtherFuel1Coef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel1", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.OtherFuel1Coef.NucLoSched, - ErrorsFound); - } - } break; - case Constant::eFuel::OtherFuel2: { - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - ShowWarningError(state, - format("{}: {} already entered. Previous entry will be used.", cCurrentModuleObject, FuelType.FuelTypeNames(Loop))); - continue; - } - Pollution.OtherFuel2Coef.FuelFactorUsed = true; - // OtherFuel2 Coeffs - Pollution.OtherFuel2Coef.Source = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - Pollution.OtherFuel2Coef.SourceSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.CO2 = state.dataIPShortCut->rNumericArgs(2); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3), - Pollution.OtherFuel2Coef.CO2Sched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.CO = state.dataIPShortCut->rNumericArgs(3); - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - Pollution.OtherFuel2Coef.COSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.CH4 = state.dataIPShortCut->rNumericArgs(4); - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5), - Pollution.OtherFuel2Coef.CH4Sched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.NOx = state.dataIPShortCut->rNumericArgs(5); - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6), - Pollution.OtherFuel2Coef.NOxSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.N2O = state.dataIPShortCut->rNumericArgs(6); - if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7), - Pollution.OtherFuel2Coef.N2OSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.SO2 = state.dataIPShortCut->rNumericArgs(7); - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8), - Pollution.OtherFuel2Coef.SO2Sched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.PM = state.dataIPShortCut->rNumericArgs(8); - if (!state.dataIPShortCut->lAlphaFieldBlanks(9)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - Pollution.OtherFuel2Coef.PMSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.PM10 = state.dataIPShortCut->rNumericArgs(9); - if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(10), - state.dataIPShortCut->cAlphaArgs(10), - Pollution.OtherFuel2Coef.PM10Sched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.PM25 = state.dataIPShortCut->rNumericArgs(10); - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11), - Pollution.OtherFuel2Coef.PM25Sched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.NH3 = state.dataIPShortCut->rNumericArgs(11); - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12), - Pollution.OtherFuel2Coef.NH3Sched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.NMVOC = state.dataIPShortCut->rNumericArgs(12); - if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(13), - state.dataIPShortCut->cAlphaArgs(13), - Pollution.OtherFuel2Coef.NMVOCSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.Hg = state.dataIPShortCut->rNumericArgs(13); - if (!state.dataIPShortCut->lAlphaFieldBlanks(14)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(14), - state.dataIPShortCut->cAlphaArgs(14), - Pollution.OtherFuel2Coef.HgSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.Pb = state.dataIPShortCut->rNumericArgs(14); - if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(15), - state.dataIPShortCut->cAlphaArgs(15), - Pollution.OtherFuel2Coef.PbSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.Water = state.dataIPShortCut->rNumericArgs(15); - if (!state.dataIPShortCut->lAlphaFieldBlanks(16)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(16), - state.dataIPShortCut->cAlphaArgs(16), - Pollution.OtherFuel2Coef.WaterSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.NucHi = state.dataIPShortCut->rNumericArgs(16); - if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(17), - state.dataIPShortCut->cAlphaArgs(17), - Pollution.OtherFuel2Coef.NucHiSched, - ErrorsFound); - } - Pollution.OtherFuel2Coef.NucLo = state.dataIPShortCut->rNumericArgs(17); - if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - CheckFFSchedule(state, - cCurrentModuleObject, - "OtherFuel2", - state.dataIPShortCut->cAlphaFieldNames(18), - state.dataIPShortCut->cAlphaArgs(18), - Pollution.OtherFuel2Coef.NucLoSched, - ErrorsFound); - } - } break; - default: { - ShowSevereError(state, format("Illegal FuelType for Pollution Calc Entered={}", FuelType.FuelTypeNames(Loop))); - ErrorsFound = true; - } break; - } + ip->getObjectItem(state, + ipsc->cCurrentModuleObject, + Loop, + ipsc->cAlphaArgs, + NumAlphas, + ipsc->rNumericArgs, + NumNums, + IOStat, + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + + Constant::eFuel fuel = static_cast(getEnumValue(Constant::eFuelNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(1)))); + + auto &pollCoeff = pm->pollCoeffs[(int)fuel]; + if (pollCoeff.used) { + ShowWarningError(state, format("{}: {} already entered. Previous entry will be used.", + ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel])); + continue; + } + + pollCoeff.used = true; + + pollCoeff.sourceSchedNum = ipsc->rNumericArgs(1); + if (!ipsc->lAlphaFieldBlanks(2)) { + pollCoeff.sourceSchedNum = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(2)); + if (pollCoeff.sourceSchedNum == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); + ErrorsFound = true; + } else if (!ScheduleManager::CheckScheduleValueMinMax(state, pollCoeff.sourceSchedNum, true, 0.0)) { + ShowSevereError(state, format("{}: {}, invalid {}=\"{}\" invalid values.", + ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel], + ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2))); + ShowContinueError(state, "Schedule values must be (>=0.)."); + ErrorsFound = true; + } + } + + for (int iPollutant = 0; iPollutant < (int)Pollutant2::Num; ++iPollutant) { + pollCoeff.pollutantCoeffs[iPollutant] = ipsc->rNumericArgs(iPollutant+2); + if (!ipsc->lAlphaFieldBlanks(iPollutant+3)) { + + pollCoeff.pollutantSchedNums[iPollutant] = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(iPollutant+3)); + if (pollCoeff.pollutantSchedNums[iPollutant] == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(iPollutant+3), ipsc->cAlphaArgs(iPollutant+3)); + ErrorsFound = true; + } else if (!ScheduleManager::CheckScheduleValueMinMax(state, pollCoeff.pollutantSchedNums[iPollutant], true, 0.0)) { + ShowSevereError(state, format("{}: {}, invalid {}=\"{}\" invalid values.", + ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel], + ipsc->cAlphaFieldNames(iPollutant+3), ipsc->cAlphaArgs(iPollutant+3))); + ShowContinueError(state, "Schedule values must be (>=0.)."); + ErrorsFound = true; + } + } + } // for (iPollutant) } // End of the NumEnergyTypes Do Loop - FuelType.ElecFacilityIndex = GetMeterIndex(state, "Electricity:Facility"); - FuelType.DieselFacilityIndex = GetMeterIndex(state, "Diesel:Facility"); - FuelType.PurchCoolFacilityIndex = GetMeterIndex(state, "DistrictCooling:Facility"); - FuelType.PurchHeatFacilityIndex = GetMeterIndex(state, "DistrictHeating:Facility"); - FuelType.NatGasFacilityIndex = GetMeterIndex(state, "NaturalGas:Facility"); - FuelType.GasolineFacilityIndex = GetMeterIndex(state, "Gasoline:Facility"); - FuelType.CoalFacilityIndex = GetMeterIndex(state, "Coal:Facility"); - FuelType.FuelOil1FacilityIndex = GetMeterIndex(state, "FuelOilNo1:Facility"); - FuelType.FuelOil2FacilityIndex = GetMeterIndex(state, "FuelOilNo2:Facility"); - FuelType.PropaneFacilityIndex = GetMeterIndex(state, "Propane:Facility"); - FuelType.OtherFuel1FacilityIndex = GetMeterIndex(state, "OtherFuel1:Facility"); - FuelType.OtherFuel2FacilityIndex = GetMeterIndex(state, "OtherFuel2:Facility"); - FuelType.ElecProducedFacilityIndex = GetMeterIndex(state, "ElectricityProduced:Facility"); - FuelType.SteamFacilityIndex = GetMeterIndex(state, "Steam:Facility"); - FuelType.ElecPurchasedFacilityIndex = GetMeterIndex(state, "ElectricityPurchased:Facility"); - FuelType.ElecSurplusSoldFacilityIndex = GetMeterIndex(state, "ElectricitySurplusSold:Facility"); + for (int iMeter = 0; iMeter < (int)PollFacilityMeter::Num; ++iMeter) { + pm->facilityMeterNums[iMeter] = GetMeterIndex(state, pollFacilityMeterNames[iMeter]); + } - if (state.dataPollutionModule->PollutionReportSetup) { // only do this if reporting on the pollution + if (pm->PollutionReportSetup) { // only do this if reporting on the pollution // Need to go through all of the Fuel Types and make sure a Fuel Factor was found for each type of energy being simulated // Check for Electricity - if (!Pollution.ElecCoef.FuelFactorUsed && - ((FuelType.ElecFacilityIndex > 0) || (FuelType.ElecProducedFacilityIndex > 0) || (FuelType.PurchCoolFacilityIndex > 0))) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for ELECTRICITY", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::Electricity].used && + ((pm->facilityMeterNums[(int)PollFacilityMeter::Electricity] > 0) || + (pm->facilityMeterNums[(int)PollFacilityMeter::ElectricityProduced] > 0) || + (pm->facilityMeterNums[(int)PollFacilityMeter::CoolPurchased] > 0))) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for ELECTRICITY", + ipsc->cCurrentModuleObject)); ErrorsFound = true; } + // Check for Natural Gas - if (!Pollution.NatGasCoef.FuelFactorUsed && - ((FuelType.NatGasFacilityIndex > 0) || (FuelType.PurchHeatFacilityIndex > 0) || (FuelType.SteamFacilityIndex > 0))) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for NATURAL GAS", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::NaturalGas].used && + ((pm->facilityMeterNums[(int)PollFacilityMeter::NaturalGas] > 0) || + (pm->facilityMeterNums[(int)PollFacilityMeter::HeatPurchased] > 0) || + (pm->facilityMeterNums[(int)PollFacilityMeter::Steam] > 0))) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for NATURAL GAS", + ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for FuelOilNo2 (Residual Oil) - if (!Pollution.FuelOil2Coef.FuelFactorUsed && (FuelType.FuelOil2FacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #2", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::FuelOil2].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::FuelOil2] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #2", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for FuelOilNo1 (Distillate Oil) - if (!Pollution.FuelOil1Coef.FuelFactorUsed && (FuelType.FuelOil1FacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #1", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::FuelOil1].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::FuelOil1] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #1", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Coal - if (!Pollution.CoalCoef.FuelFactorUsed && (FuelType.CoalFacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for COAL", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::Coal].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::Coal] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for COAL", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Gasoline - if (!Pollution.GasolineCoef.FuelFactorUsed && (FuelType.GasolineFacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for GASOLINE", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::Gasoline].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::Gasoline] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for GASOLINE", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Propane - if (!Pollution.PropaneCoef.FuelFactorUsed && (FuelType.PropaneFacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for PROPANE", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::Propane].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::Propane] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for PROPANE", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Diesel - if (!Pollution.DieselCoef.FuelFactorUsed && (FuelType.DieselFacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for DIESEL", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::Diesel].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::Diesel] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for DIESEL", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for OtherFuel1 - if (!Pollution.OtherFuel1Coef.FuelFactorUsed && (FuelType.OtherFuel1FacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for OTHERFUEL1", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::OtherFuel1].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::OtherFuel1] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for OTHERFUEL1", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for OtherFuel2 - if (!Pollution.OtherFuel2Coef.FuelFactorUsed && (FuelType.OtherFuel2FacilityIndex > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for OTHERFUEL2", cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::OtherFuel2].used && + (pm->facilityMeterNums[(int)PollFacilityMeter::OtherFuel2] > 0)) { + ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for OTHERFUEL2", ipsc->cCurrentModuleObject)); ErrorsFound = true; } } @@ -2188,3998 +419,214 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) // Uses the status flags to trigger events. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - - if (state.dataPollutionModule->GetInputFlagPollution) { + auto &pm = state.dataPollution; + + if (pm->GetInputFlagPollution) { GetPollutionFactorInput(state); - state.dataPollutionModule->GetInputFlagPollution = false; + pm->GetInputFlagPollution = false; } - auto &Pollution = state.dataPollutionModule->Pollution; - auto &FuelType = state.dataPollutionModule->FuelType; - for (Loop = 1; Loop <= static_cast(PollFactor::Num); ++Loop) { - // if (FuelType.FuelTypeNames(Loop).empty()) continue; + for (int iFuel = 0; iFuel < (int)PollFuel::Num; ++iFuel) { - switch (FuelType.FuelTypeNames(Loop)) { - case Constant::eFuel::NaturalGas: { // Pollutants from Natural Gas - SetupOutputVariable(state, - "Environmental Impact NaturalGas Source Energy", - OutputProcessor::Unit::J, - Pollution.NatGasComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "NaturalGasEmissions", - {}, - ""); + auto &pollComp = pm->pollComps[(int)pollFuel2pollFuelComponent[iFuel]]; + + // Need to check whether this fuel is used? + SetupOutputVariable(state, + format("Environmental Impact {} Source Energy", Constant::eFuelNames[(int)pollFuel2fuel[iFuel]]), + OutputProcessor::Unit::J, + pollComp.sourceVal, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Source", + format("{}Emissions", Constant::eFuelNames[(int)pollFuel2fuel[iFuel]]), + {}, + ""); + + for (int iPollutant2 = 0; iPollutant2 < (int)Pollutant2::Num; ++iPollutant2) { SetupOutputVariable(state, - "Environmental Impact NaturalGas N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.N2OPollution, + format("Environmental Impact {} {}", + Constant::eFuelNames[(int)pollFuel2fuel[iFuel]], poll2outVarStrs[iPollutant2]), + poll2Units[iPollutant2], + pollComp.pollutantVals[iPollutant2], OutputProcessor::SOVTimeStepType::System, OutputProcessor::SOVStoreType::Summed, "Site", {}, - "N2O", - "NaturalGasEmissions", + poll2Names[iPollutant2], + format("{}Emissions", Constant::eFuelNames[(int)pollFuel2fuel[iFuel]]), {}, ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.NatGasComp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.NatGasComp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "NaturalGasEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact NaturalGas Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.NatGasComp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "NaturalGasEmissions", - {}, - ""); - } break; - case Constant::eFuel::FuelOilNo2: { // Pollutants from FuelOilNo2 - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 Source Energy", - OutputProcessor::Unit::J, - Pollution.FuelOil2Comp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.FuelOil2Comp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil2Comp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "FuelOilNo2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo2 Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.FuelOil2Comp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "FuelOilNo2Emissions", - {}, - ""); - } break; - case Constant::eFuel::FuelOilNo1: { // Pollutants from FuelOilNo1 - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 Source Energy", - OutputProcessor::Unit::J, - Pollution.FuelOil1Comp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.FuelOil1Comp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.FuelOil1Comp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "FuelOilNo1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact FuelOilNo1 Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.FuelOil1Comp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "FuelOilNo1Emissions", - {}, - ""); - } break; - case Constant::eFuel::Coal: { // Pollutants from Coal - SetupOutputVariable(state, - "Environmental Impact Coal Source Energy", - OutputProcessor::Unit::J, - Pollution.CoalComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.CoalComp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.CoalComp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "CoalEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Coal Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.CoalComp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "CoalEmissions", - {}, - ""); - } break; - case Constant::eFuel::Electricity: { // Pollutants from Electricity - SetupOutputVariable(state, - "Environmental Impact Electricity Source Energy", - OutputProcessor::Unit::J, - Pollution.ElecComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.ElecComp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.ElecComp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Electricity Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.ElecComp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "ElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Purchased Electricity Source Energy", - OutputProcessor::Unit::J, - Pollution.ElecPurchComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "PurchasedElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Surplus Sold Electricity Source", - OutputProcessor::Unit::J, - Pollution.ElecSurplusSoldComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "SoldElectricityEmissions", - {}, - ""); - } break; - case Constant::eFuel::Gasoline: { // Pollutants from Gasoline - SetupOutputVariable(state, - "Environmental Impact Gasoline Source Energy", - OutputProcessor::Unit::J, - Pollution.GasolineComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.GasolineComp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.GasolineComp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "GasolineEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Gasoline Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.GasolineComp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "GasolineEmissions", - {}, - ""); - } break; - case Constant::eFuel::Propane: { // Pollutants from Propane - SetupOutputVariable(state, - "Environmental Impact Propane Source Energy", - OutputProcessor::Unit::J, - Pollution.PropaneComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.PropaneComp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.PropaneComp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "PropaneEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Propane Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.PropaneComp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "PropaneEmissions", - {}, - ""); - } break; - case Constant::eFuel::Diesel: { // Pollutants from Diesel - SetupOutputVariable(state, - "Environmental Impact Diesel Source Energy", - OutputProcessor::Unit::J, - Pollution.DieselComp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.DieselComp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.DieselComp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "DieselEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Diesel Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.DieselComp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "DieselEmissions", - {}, - ""); - } break; - case Constant::eFuel::OtherFuel1: { // Pollutants from OtherFuel1 - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 Source Energy", - OutputProcessor::Unit::J, - Pollution.OtherFuel1Comp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.OtherFuel1Comp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel1Comp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "OtherFuel1Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel1 Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.OtherFuel1Comp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "OtherFuel1Emissions", - {}, - ""); - } break; - case Constant::eFuel::OtherFuel2: { // Pollutants from OtherFuel2 - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 Source Energy", - OutputProcessor::Unit::J, - Pollution.OtherFuel2Comp.Source, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 CO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.CO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO2", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 CO Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.COPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CO", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 CH4 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.CH4Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "CH4", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 NOx Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.NOxPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NOx", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 N2O Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.N2OPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "N2O", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 SO2 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.SO2Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "SO2", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 PM Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.PMPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 PM10 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.PM10Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM10", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 PM2.5 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.PM25Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "PM2.5", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 NH3 Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.NH3Pollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NH3", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 NMVOC Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.NMVOCPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "NMVOC", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 Hg Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.HgPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Hg", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 Pb Emissions Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.PbPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Pb", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 Water Consumption Volume", - OutputProcessor::Unit::L, - Pollution.OtherFuel2Comp.WaterPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "WaterEnvironmentalFactors", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 Nuclear High Level Waste Mass", - OutputProcessor::Unit::kg, - Pollution.OtherFuel2Comp.NucHiPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear High", - "OtherFuel2Emissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact OtherFuel2 Nuclear Low Level Waste Volume", - OutputProcessor::Unit::m3, - Pollution.OtherFuel2Comp.NucLoPollution, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Nuclear Low", - "OtherFuel2Emissions", - {}, - ""); - } break; - default: - break; - } - - } // End of the NumEnergyTypes Do Loop - - // Always setup the Total Carbon Equivalent - SetupOutputVariable(state, - "Environmental Impact Total N2O Emissions Carbon Equivalent Mass", - OutputProcessor::Unit::kg, - Pollution.TotCarbonEquivFromN2O, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Carbon Equivalent", - "CarbonEquivalentEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Total CH4 Emissions Carbon Equivalent Mass", - OutputProcessor::Unit::kg, - Pollution.TotCarbonEquivFromCH4, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Carbon Equivalent", - "CarbonEquivalentEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Total CO2 Emissions Carbon Equivalent Mass", - OutputProcessor::Unit::kg, - Pollution.TotCarbonEquivFromCO2, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Carbon Equivalent", - "CarbonEquivalentEmissions", - {}, - ""); -} - -void CheckPollutionMeterReporting(EnergyPlusData &state) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN October 2008 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // - - // in progress - if (state.dataPollutionModule->NumFuelFactors == 0 || state.dataPollutionModule->NumEnvImpactFactors == 0) { - if (ReportingThisVariable(state, "Environmental Impact Total N2O Emissions Carbon Equivalent Mass") || - ReportingThisVariable(state, "Environmental Impact Total CH4 Emissions Carbon Equivalent Mass") || - ReportingThisVariable(state, "Environmental Impact Total CO2 Emissions Carbon Equivalent Mass") || - ReportingThisVariable(state, "Carbon Equivalent:Facility") || - ReportingThisVariable(state, "CarbonEquivalentEmissions:Carbon Equivalent")) { - ShowWarningError( - state, "GetPollutionFactorInput: Requested reporting for Carbon Equivalent Pollution, but insufficient information is entered."); - ShowContinueError( - state, R"(Both "FuelFactors" and "EnvironmentalImpactFactors" must be entered or the displayed carbon pollution will all be zero.)"); - } - } -} - -void CheckFFSchedule(EnergyPlusData &state, - std::string const ¤tModuleObject, // the module Object - std::string const &resourceType, // resource type (Natural Gas, etc) - std::string const &fieldName, // Actual field name - std::string const &ScheduleName, // Schedule Name as input - int &SchedulePtr, // Schedule Index - bool &ErrorsFound // true if errors found -) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN September 2009 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // This support routine performs the "obtain schedule pointer" and checks Fuel Factor - // schedules for validity (values must be >= 0). - - // Using/Aliasing - using ScheduleManager::CheckScheduleValueMinMax; - using ScheduleManager::GetScheduleIndex; - - SchedulePtr = GetScheduleIndex(state, ScheduleName); - if (SchedulePtr == 0) { - ShowSevereError(state, format("{}: {}, invalid {}=\"{}\" not found.", currentModuleObject, resourceType, fieldName, ScheduleName)); - ErrorsFound = true; - } else if (!CheckScheduleValueMinMax(state, SchedulePtr, true, 0.0)) { - ShowSevereError(state, format("{}: {}, invalid {}=\"{}\" invalid values.", currentModuleObject, resourceType, fieldName, ScheduleName)); - ShowContinueError(state, "Schedule values must be (>=0.)."); - ErrorsFound = true; - } -} - -// End of Get Input subroutines for the Pollution Module -//****************************************************************************** - -void CalcPollution(EnergyPlusData &state) -{ - // SUBROUTINE INFORMATION: - // AUTHOR Richard Liesen - // DATE WRITTEN 1998 - // MODIFIED na - // RE-ENGINEERED December 2003 RJL - - // PURPOSE OF THIS SUBROUTINE: - // CalcPollution - Does the Pollutant Calculation - - // METHODOLOGY EMPLOYED: - // NA - - // REFERENCES: - // na - - // Using/Aliasing - using ScheduleManager::GetCurrentScheduleValue; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 ElecValue; - Real64 NatGasValue; - Real64 FuelOil1Value; - Real64 FuelOil2Value; - Real64 CoalValue; - Real64 GasolineValue; - Real64 PropaneValue; - Real64 DieselValue; - Real64 OtherFuel1Value; - Real64 OtherFuel2Value; - - // Then the amount of Pollution produced by each fuel type is - // calculated in kgs. - // Input units for the coefficients is not standard and needs to be converted here. - // Most of the units are g/MJ, however water is in L/MJ and low level nuclear water is m3/MJ - // so only the energy has to be converted from J to MJ. - - // For each pollution/fuel type, Schedule values are allowed. Thus, calculations are bundled. - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - auto &Pollution = state.dataPollutionModule->Pollution; - auto &FuelType = state.dataPollutionModule->FuelType; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.CO2Pollution = 0.0; - if (Pollution.ElecCoef.CO2Sched == 0) { - ElecValue = Pollution.ElecCoef.CO2 * 0.001; - } else { - ElecValue = Pollution.ElecCoef.CO2 * GetCurrentScheduleValue(state, Pollution.ElecCoef.CO2Sched) * 0.001; - } - Pollution.ElecComp.CO2Pollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.CO2Pollution = 0.0; - if (Pollution.NatGasCoef.CO2Sched == 0) { - NatGasValue = Pollution.NatGasCoef.CO2 * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.CO2 * GetCurrentScheduleValue(state, Pollution.NatGasCoef.CO2Sched) * 0.001; - } - Pollution.NatGasComp.CO2Pollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.CO2Pollution = 0.0; - if (Pollution.FuelOil1Coef.CO2Sched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.CO2 * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.CO2 * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.CO2Sched) * 0.001; - } - Pollution.FuelOil1Comp.CO2Pollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.CO2Pollution = 0.0; - if (Pollution.FuelOil2Coef.CO2Sched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.CO2 * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.CO2 * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.CO2Sched) * 0.001; - } - Pollution.FuelOil2Comp.CO2Pollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.CO2Pollution = 0.0; - if (Pollution.CoalCoef.CO2Sched == 0) { - CoalValue = Pollution.CoalCoef.CO2 * 0.001; - } else { - CoalValue = Pollution.CoalCoef.CO2 * GetCurrentScheduleValue(state, Pollution.CoalCoef.CO2Sched) * 0.001; - } - Pollution.CoalComp.CO2Pollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.CO2Pollution = 0.0; - if (Pollution.GasolineCoef.CO2Sched == 0) { - GasolineValue = Pollution.GasolineCoef.CO2 * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.CO2 * GetCurrentScheduleValue(state, Pollution.GasolineCoef.CO2Sched) * 0.001; - } - Pollution.GasolineComp.CO2Pollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.CO2Pollution = 0.0; - if (Pollution.PropaneCoef.CO2Sched == 0) { - PropaneValue = Pollution.PropaneCoef.CO2 * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.CO2 * GetCurrentScheduleValue(state, Pollution.PropaneCoef.CO2Sched) * 0.001; - } - Pollution.PropaneComp.CO2Pollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.CO2Pollution = 0.0; - if (Pollution.DieselCoef.CO2Sched == 0) { - DieselValue = Pollution.DieselCoef.CO2 * 0.001; - } else { - DieselValue = Pollution.DieselCoef.CO2 * GetCurrentScheduleValue(state, Pollution.DieselCoef.CO2Sched) * 0.001; - } - Pollution.DieselComp.CO2Pollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.CO2Pollution = 0.0; - if (Pollution.OtherFuel1Coef.CO2Sched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.CO2 * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.CO2 * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.CO2Sched) * 0.001; - } - Pollution.OtherFuel1Comp.CO2Pollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.CO2Pollution = 0.0; - if (Pollution.OtherFuel2Coef.CO2Sched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.CO2 * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.CO2 * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.CO2Sched) * 0.001; - } - Pollution.OtherFuel2Comp.CO2Pollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - Pollution.CO2PollutTotal = Pollution.ElecComp.CO2Pollution + Pollution.NatGasComp.CO2Pollution + Pollution.FuelOil1Comp.CO2Pollution + - Pollution.FuelOil2Comp.CO2Pollution + Pollution.CoalComp.CO2Pollution + Pollution.GasolineComp.CO2Pollution + - Pollution.PropaneComp.CO2Pollution + Pollution.DieselComp.CO2Pollution + Pollution.OtherFuel1Comp.CO2Pollution + - Pollution.OtherFuel2Comp.CO2Pollution; - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.NOxPollution = 0.0; - if (Pollution.ElecCoef.NOxSched == 0) { - ElecValue = Pollution.ElecCoef.NOx * 0.001; - } else { - ElecValue = Pollution.ElecCoef.NOx * GetCurrentScheduleValue(state, Pollution.ElecCoef.NOxSched) * 0.001; - } - Pollution.ElecComp.NOxPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.NOxPollution = 0.0; - if (Pollution.NatGasCoef.NOxSched == 0) { - NatGasValue = Pollution.NatGasCoef.NOx * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.NOx * GetCurrentScheduleValue(state, Pollution.NatGasCoef.NOxSched) * 0.001; - } - Pollution.NatGasComp.NOxPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.NOxPollution = 0.0; - if (Pollution.FuelOil1Coef.NOxSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.NOx * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.NOx * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.NOxSched) * 0.001; - } - Pollution.FuelOil1Comp.NOxPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.NOxPollution = 0.0; - if (Pollution.FuelOil2Coef.NOxSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.NOx * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.NOx * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.NOxSched) * 0.001; - } - Pollution.FuelOil2Comp.NOxPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.NOxPollution = 0.0; - if (Pollution.CoalCoef.NOxSched == 0) { - CoalValue = Pollution.CoalCoef.NOx * 0.001; - } else { - CoalValue = Pollution.CoalCoef.NOx * GetCurrentScheduleValue(state, Pollution.CoalCoef.NOxSched) * 0.001; - } - Pollution.CoalComp.NOxPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.NOxPollution = 0.0; - if (Pollution.GasolineCoef.NOxSched == 0) { - GasolineValue = Pollution.GasolineCoef.NOx * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.NOx * GetCurrentScheduleValue(state, Pollution.GasolineCoef.NOxSched) * 0.001; - } - Pollution.GasolineComp.NOxPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.NOxPollution = 0.0; - if (Pollution.PropaneCoef.NOxSched == 0) { - PropaneValue = Pollution.PropaneCoef.NOx * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.NOx * GetCurrentScheduleValue(state, Pollution.PropaneCoef.NOxSched) * 0.001; - } - Pollution.PropaneComp.NOxPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.NOxPollution = 0.0; - if (Pollution.DieselCoef.NOxSched == 0) { - DieselValue = Pollution.DieselCoef.NOx * 0.001; - } else { - DieselValue = Pollution.DieselCoef.NOx * GetCurrentScheduleValue(state, Pollution.DieselCoef.NOxSched) * 0.001; - } - Pollution.DieselComp.NOxPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.NOxPollution = 0.0; - if (Pollution.OtherFuel1Coef.NOxSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.NOx * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.NOx * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.NOxSched) * 0.001; - } - Pollution.OtherFuel1Comp.NOxPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.NOxPollution = 0.0; - if (Pollution.OtherFuel2Coef.NOxSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.NOx * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.NOx * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.NOxSched) * 0.001; - } - Pollution.OtherFuel2Comp.NOxPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.CH4Pollution = 0.0; - if (Pollution.ElecCoef.CH4Sched == 0) { - ElecValue = Pollution.ElecCoef.CH4 * 0.001; - } else { - ElecValue = Pollution.ElecCoef.CH4 * GetCurrentScheduleValue(state, Pollution.ElecCoef.CH4Sched) * 0.001; - } - Pollution.ElecComp.CH4Pollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.CH4Pollution = 0.0; - if (Pollution.NatGasCoef.CH4Sched == 0) { - NatGasValue = Pollution.NatGasCoef.CH4 * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.CH4 * GetCurrentScheduleValue(state, Pollution.NatGasCoef.CH4Sched) * 0.001; - } - Pollution.NatGasComp.CH4Pollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.CH4Pollution = 0.0; - if (Pollution.FuelOil1Coef.CH4Sched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.CH4 * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.CH4 * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.CH4Sched) * 0.001; - } - Pollution.FuelOil1Comp.CH4Pollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.CH4Pollution = 0.0; - if (Pollution.FuelOil2Coef.CH4Sched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.CH4 * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.CH4 * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.CH4Sched) * 0.001; - } - Pollution.FuelOil2Comp.CH4Pollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.CH4Pollution = 0.0; - if (Pollution.CoalCoef.CH4Sched == 0) { - CoalValue = Pollution.CoalCoef.CH4 * 0.001; - } else { - CoalValue = Pollution.CoalCoef.CH4 * GetCurrentScheduleValue(state, Pollution.CoalCoef.CH4Sched) * 0.001; - } - Pollution.CoalComp.CH4Pollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.CH4Pollution = 0.0; - if (Pollution.GasolineCoef.CH4Sched == 0) { - GasolineValue = Pollution.GasolineCoef.CH4 * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.CH4 * GetCurrentScheduleValue(state, Pollution.GasolineCoef.CH4Sched) * 0.001; - } - Pollution.GasolineComp.CH4Pollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.CH4Pollution = 0.0; - if (Pollution.PropaneCoef.CH4Sched == 0) { - PropaneValue = Pollution.PropaneCoef.CH4 * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.CH4 * GetCurrentScheduleValue(state, Pollution.PropaneCoef.CH4Sched) * 0.001; - } - Pollution.PropaneComp.CH4Pollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.CH4Pollution = 0.0; - if (Pollution.DieselCoef.CH4Sched == 0) { - DieselValue = Pollution.DieselCoef.CH4 * 0.001; - } else { - DieselValue = Pollution.DieselCoef.CH4 * GetCurrentScheduleValue(state, Pollution.DieselCoef.CH4Sched) * 0.001; - } - Pollution.DieselComp.CH4Pollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.CH4Pollution = 0.0; - if (Pollution.OtherFuel1Coef.CH4Sched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.CH4 * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.CH4 * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.CH4Sched) * 0.001; - } - Pollution.OtherFuel1Comp.CH4Pollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.CH4Pollution = 0.0; - if (Pollution.OtherFuel2Coef.CH4Sched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.CH4 * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.CH4 * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.CH4Sched) * 0.001; - } - Pollution.OtherFuel2Comp.CH4Pollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - Pollution.CH4PollutTotal = Pollution.ElecComp.CH4Pollution + Pollution.NatGasComp.CH4Pollution + Pollution.FuelOil1Comp.CH4Pollution + - Pollution.FuelOil2Comp.CH4Pollution + Pollution.CoalComp.CH4Pollution + Pollution.GasolineComp.CH4Pollution + - Pollution.PropaneComp.CH4Pollution + Pollution.DieselComp.CH4Pollution + Pollution.OtherFuel1Comp.CH4Pollution + - Pollution.OtherFuel1Comp.CH4Pollution; - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.COPollution = 0.0; - if (Pollution.ElecCoef.COSched == 0) { - ElecValue = Pollution.ElecCoef.CO * 0.001; - } else { - ElecValue = Pollution.ElecCoef.CO * GetCurrentScheduleValue(state, Pollution.ElecCoef.COSched) * 0.001; - } - Pollution.ElecComp.COPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.COPollution = 0.0; - if (Pollution.NatGasCoef.COSched == 0) { - NatGasValue = Pollution.NatGasCoef.CO * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.CO * GetCurrentScheduleValue(state, Pollution.NatGasCoef.COSched) * 0.001; - } - Pollution.NatGasComp.COPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.COPollution = 0.0; - if (Pollution.FuelOil1Coef.COSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.CO * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.CO * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.COSched) * 0.001; - } - Pollution.FuelOil1Comp.COPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.COPollution = 0.0; - if (Pollution.FuelOil2Coef.COSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.CO * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.CO * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.COSched) * 0.001; - } - Pollution.FuelOil2Comp.COPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.COPollution = 0.0; - if (Pollution.CoalCoef.COSched == 0) { - CoalValue = Pollution.CoalCoef.CO * 0.001; - } else { - CoalValue = Pollution.CoalCoef.CO * GetCurrentScheduleValue(state, Pollution.CoalCoef.COSched) * 0.001; - } - Pollution.CoalComp.COPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.COPollution = 0.0; - if (Pollution.GasolineCoef.COSched == 0) { - GasolineValue = Pollution.GasolineCoef.CO * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.CO * GetCurrentScheduleValue(state, Pollution.GasolineCoef.COSched) * 0.001; - } - Pollution.GasolineComp.COPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.COPollution = 0.0; - if (Pollution.PropaneCoef.COSched == 0) { - PropaneValue = Pollution.PropaneCoef.CO * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.CO * GetCurrentScheduleValue(state, Pollution.PropaneCoef.COSched) * 0.001; - } - Pollution.PropaneComp.COPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.COPollution = 0.0; - if (Pollution.DieselCoef.COSched == 0) { - DieselValue = Pollution.DieselCoef.CO * 0.001; - } else { - DieselValue = Pollution.DieselCoef.CO * GetCurrentScheduleValue(state, Pollution.DieselCoef.COSched) * 0.001; - } - Pollution.DieselComp.COPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.COPollution = 0.0; - if (Pollution.OtherFuel1Coef.COSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.CO * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.CO * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.COSched) * 0.001; - } - Pollution.OtherFuel1Comp.COPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.COPollution = 0.0; - if (Pollution.OtherFuel2Coef.COSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.CO * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.CO * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.COSched) * 0.001; - } - Pollution.OtherFuel2Comp.COPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.N2OPollution = 0.0; - if (Pollution.ElecCoef.N2OSched == 0) { - ElecValue = Pollution.ElecCoef.N2O * 0.001; - } else { - ElecValue = Pollution.ElecCoef.N2O * GetCurrentScheduleValue(state, Pollution.ElecCoef.N2OSched) * 0.001; - } - Pollution.ElecComp.N2OPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.N2OPollution = 0.0; - if (Pollution.NatGasCoef.N2OSched == 0) { - NatGasValue = Pollution.NatGasCoef.N2O * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.N2O * GetCurrentScheduleValue(state, Pollution.NatGasCoef.N2OSched) * 0.001; - } - Pollution.NatGasComp.N2OPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.N2OPollution = 0.0; - if (Pollution.FuelOil1Coef.N2OSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.N2O * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.N2O * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.N2OSched) * 0.001; - } - Pollution.FuelOil1Comp.N2OPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.N2OPollution = 0.0; - if (Pollution.FuelOil2Coef.N2OSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.N2O * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.N2O * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.N2OSched) * 0.001; - } - Pollution.FuelOil2Comp.N2OPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.N2OPollution = 0.0; - if (Pollution.CoalCoef.N2OSched == 0) { - CoalValue = Pollution.CoalCoef.N2O * 0.001; - } else { - CoalValue = Pollution.CoalCoef.N2O * GetCurrentScheduleValue(state, Pollution.CoalCoef.N2OSched) * 0.001; - } - Pollution.CoalComp.N2OPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.N2OPollution = 0.0; - if (Pollution.GasolineCoef.N2OSched == 0) { - GasolineValue = Pollution.GasolineCoef.N2O * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.N2O * GetCurrentScheduleValue(state, Pollution.GasolineCoef.N2OSched) * 0.001; - } - Pollution.GasolineComp.N2OPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.N2OPollution = 0.0; - if (Pollution.PropaneCoef.N2OSched == 0) { - PropaneValue = Pollution.PropaneCoef.N2O * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.N2O * GetCurrentScheduleValue(state, Pollution.PropaneCoef.N2OSched) * 0.001; - } - Pollution.PropaneComp.N2OPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.N2OPollution = 0.0; - if (Pollution.DieselCoef.N2OSched == 0) { - DieselValue = Pollution.DieselCoef.N2O * 0.001; - } else { - DieselValue = Pollution.DieselCoef.N2O * GetCurrentScheduleValue(state, Pollution.DieselCoef.N2OSched) * 0.001; - } - Pollution.DieselComp.N2OPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.N2OPollution = 0.0; - if (Pollution.OtherFuel1Coef.N2OSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.N2O * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.N2O * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.N2OSched) * 0.001; - } - Pollution.OtherFuel1Comp.N2OPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.N2OPollution = 0.0; - if (Pollution.OtherFuel2Coef.N2OSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.N2O * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.N2O * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.N2OSched) * 0.001; - } - Pollution.OtherFuel2Comp.N2OPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - Pollution.N2OPollutTotal = Pollution.ElecComp.N2OPollution + Pollution.NatGasComp.N2OPollution + Pollution.FuelOil1Comp.N2OPollution + - Pollution.FuelOil2Comp.N2OPollution + Pollution.CoalComp.N2OPollution + Pollution.GasolineComp.N2OPollution + - Pollution.PropaneComp.N2OPollution + Pollution.DieselComp.N2OPollution + Pollution.OtherFuel1Comp.N2OPollution + - Pollution.OtherFuel2Comp.N2OPollution; - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.SO2Pollution = 0.0; - if (Pollution.ElecCoef.SO2Sched == 0) { - ElecValue = Pollution.ElecCoef.SO2 * 0.001; - } else { - ElecValue = Pollution.ElecCoef.SO2 * GetCurrentScheduleValue(state, Pollution.ElecCoef.SO2Sched) * 0.001; - } - Pollution.ElecComp.SO2Pollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.SO2Pollution = 0.0; - if (Pollution.NatGasCoef.SO2Sched == 0) { - NatGasValue = Pollution.NatGasCoef.SO2 * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.SO2 * GetCurrentScheduleValue(state, Pollution.NatGasCoef.SO2Sched) * 0.001; - } - Pollution.NatGasComp.SO2Pollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.SO2Pollution = 0.0; - if (Pollution.FuelOil1Coef.SO2Sched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.SO2 * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.SO2 * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.SO2Sched) * 0.001; - } - Pollution.FuelOil1Comp.SO2Pollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.SO2Pollution = 0.0; - if (Pollution.FuelOil2Coef.SO2Sched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.SO2 * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.SO2 * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.SO2Sched) * 0.001; - } - Pollution.FuelOil2Comp.SO2Pollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.SO2Pollution = 0.0; - if (Pollution.CoalCoef.SO2Sched == 0) { - CoalValue = Pollution.CoalCoef.SO2 * 0.001; - } else { - CoalValue = Pollution.CoalCoef.SO2 * GetCurrentScheduleValue(state, Pollution.CoalCoef.SO2Sched) * 0.001; - } - Pollution.CoalComp.SO2Pollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.SO2Pollution = 0.0; - if (Pollution.GasolineCoef.SO2Sched == 0) { - GasolineValue = Pollution.GasolineCoef.SO2 * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.SO2 * GetCurrentScheduleValue(state, Pollution.GasolineCoef.SO2Sched) * 0.001; - } - Pollution.GasolineComp.SO2Pollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.SO2Pollution = 0.0; - if (Pollution.PropaneCoef.SO2Sched == 0) { - PropaneValue = Pollution.PropaneCoef.SO2 * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.SO2 * GetCurrentScheduleValue(state, Pollution.PropaneCoef.SO2Sched) * 0.001; - } - Pollution.PropaneComp.SO2Pollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.SO2Pollution = 0.0; - if (Pollution.DieselCoef.SO2Sched == 0) { - DieselValue = Pollution.DieselCoef.SO2 * 0.001; - } else { - DieselValue = Pollution.DieselCoef.SO2 * GetCurrentScheduleValue(state, Pollution.DieselCoef.SO2Sched) * 0.001; - } - Pollution.DieselComp.SO2Pollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.SO2Pollution = 0.0; - if (Pollution.OtherFuel1Coef.SO2Sched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.SO2 * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.SO2 * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.SO2Sched) * 0.001; - } - Pollution.OtherFuel1Comp.SO2Pollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.SO2Pollution = 0.0; - if (Pollution.OtherFuel2Coef.SO2Sched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.SO2 * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.SO2 * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.SO2Sched) * 0.001; - } - Pollution.OtherFuel2Comp.SO2Pollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.PMPollution = 0.0; - if (Pollution.ElecCoef.PMSched == 0) { - ElecValue = Pollution.ElecCoef.PM * 0.001; - } else { - ElecValue = Pollution.ElecCoef.PM * GetCurrentScheduleValue(state, Pollution.ElecCoef.PMSched) * 0.001; - } - Pollution.ElecComp.PMPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.PMPollution = 0.0; - if (Pollution.NatGasCoef.PMSched == 0) { - NatGasValue = Pollution.NatGasCoef.PM * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.PM * GetCurrentScheduleValue(state, Pollution.NatGasCoef.PMSched) * 0.001; - } - Pollution.NatGasComp.PMPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.PMPollution = 0.0; - if (Pollution.FuelOil1Coef.PMSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.PM * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.PM * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.PMSched) * 0.001; - } - Pollution.FuelOil1Comp.PMPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.PMPollution = 0.0; - if (Pollution.FuelOil2Coef.PMSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.PM * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.PM * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.PMSched) * 0.001; - } - Pollution.FuelOil2Comp.PMPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.PMPollution = 0.0; - if (Pollution.CoalCoef.PMSched == 0) { - CoalValue = Pollution.CoalCoef.PM * 0.001; - } else { - CoalValue = Pollution.CoalCoef.PM * GetCurrentScheduleValue(state, Pollution.CoalCoef.PMSched) * 0.001; - } - Pollution.CoalComp.PMPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.PMPollution = 0.0; - if (Pollution.GasolineCoef.PMSched == 0) { - GasolineValue = Pollution.GasolineCoef.PM * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.PM * GetCurrentScheduleValue(state, Pollution.GasolineCoef.PMSched) * 0.001; - } - Pollution.GasolineComp.PMPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.PMPollution = 0.0; - if (Pollution.PropaneCoef.PMSched == 0) { - PropaneValue = Pollution.PropaneCoef.PM * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.PM * GetCurrentScheduleValue(state, Pollution.PropaneCoef.PMSched) * 0.001; - } - Pollution.PropaneComp.PMPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.PMPollution = 0.0; - if (Pollution.DieselCoef.PMSched == 0) { - DieselValue = Pollution.DieselCoef.PM * 0.001; - } else { - DieselValue = Pollution.DieselCoef.PM * GetCurrentScheduleValue(state, Pollution.DieselCoef.PMSched) * 0.001; - } - Pollution.DieselComp.PMPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.PMPollution = 0.0; - if (Pollution.OtherFuel1Coef.PMSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.PM * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.PM * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.PMSched) * 0.001; - } - Pollution.OtherFuel1Comp.PMPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.PMPollution = 0.0; - if (Pollution.OtherFuel2Coef.PMSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.PM * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.PM * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.PMSched) * 0.001; - } - Pollution.OtherFuel2Comp.PMPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.PM10Pollution = 0.0; - if (Pollution.ElecCoef.PM10Sched == 0) { - ElecValue = Pollution.ElecCoef.PM10 * 0.001; - } else { - ElecValue = Pollution.ElecCoef.PM10 * GetCurrentScheduleValue(state, Pollution.ElecCoef.PM10Sched) * 0.001; - } - Pollution.ElecComp.PM10Pollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.PM10Pollution = 0.0; - if (Pollution.NatGasCoef.PM10Sched == 0) { - NatGasValue = Pollution.NatGasCoef.PM10 * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.PM10 * GetCurrentScheduleValue(state, Pollution.NatGasCoef.PM10Sched) * 0.001; - } - Pollution.NatGasComp.PM10Pollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.PM10Pollution = 0.0; - if (Pollution.FuelOil1Coef.PM10Sched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.PM10 * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.PM10 * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.PM10Sched) * 0.001; - } - Pollution.FuelOil1Comp.PM10Pollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.PM10Pollution = 0.0; - if (Pollution.FuelOil2Coef.PM10Sched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.PM10 * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.PM10 * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.PM10Sched) * 0.001; - } - Pollution.FuelOil2Comp.PM10Pollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.PM10Pollution = 0.0; - if (Pollution.CoalCoef.PM10Sched == 0) { - CoalValue = Pollution.CoalCoef.PM10 * 0.001; - } else { - CoalValue = Pollution.CoalCoef.PM10 * GetCurrentScheduleValue(state, Pollution.CoalCoef.PM10Sched) * 0.001; - } - Pollution.CoalComp.PM10Pollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.PM10Pollution = 0.0; - if (Pollution.GasolineCoef.PM10Sched == 0) { - GasolineValue = Pollution.GasolineCoef.PM10 * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.PM10 * GetCurrentScheduleValue(state, Pollution.GasolineCoef.PM10Sched) * 0.001; - } - Pollution.GasolineComp.PM10Pollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.PM10Pollution = 0.0; - if (Pollution.PropaneCoef.PM10Sched == 0) { - PropaneValue = Pollution.PropaneCoef.PM10 * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.PM10 * GetCurrentScheduleValue(state, Pollution.PropaneCoef.PM10Sched) * 0.001; - } - Pollution.PropaneComp.PM10Pollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.PM10Pollution = 0.0; - if (Pollution.DieselCoef.PM10Sched == 0) { - DieselValue = Pollution.DieselCoef.PM10 * 0.001; - } else { - DieselValue = Pollution.DieselCoef.PM10 * GetCurrentScheduleValue(state, Pollution.DieselCoef.PM10Sched) * 0.001; - } - Pollution.DieselComp.PM10Pollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.PM10Pollution = 0.0; - if (Pollution.OtherFuel1Coef.PM10Sched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.PM10 * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.PM10 * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.PM10Sched) * 0.001; - } - Pollution.OtherFuel1Comp.PM10Pollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.PM10Pollution = 0.0; - if (Pollution.OtherFuel2Coef.PM10Sched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.PM10 * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.PM10 * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.PM10Sched) * 0.001; - } - Pollution.OtherFuel2Comp.PM10Pollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.PM25Pollution = 0.0; - if (Pollution.ElecCoef.PM25Sched == 0) { - ElecValue = Pollution.ElecCoef.PM25 * 0.001; - } else { - ElecValue = Pollution.ElecCoef.PM25 * GetCurrentScheduleValue(state, Pollution.ElecCoef.PM25Sched) * 0.001; - } - Pollution.ElecComp.PM25Pollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.PM25Pollution = 0.0; - if (Pollution.NatGasCoef.PM25Sched == 0) { - NatGasValue = Pollution.NatGasCoef.PM25 * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.PM25 * GetCurrentScheduleValue(state, Pollution.NatGasCoef.PM25Sched) * 0.001; - } - Pollution.NatGasComp.PM25Pollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.PM25Pollution = 0.0; - if (Pollution.FuelOil1Coef.PM25Sched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.PM25 * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.PM25 * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.PM25Sched) * 0.001; - } - Pollution.FuelOil1Comp.PM25Pollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.PM25Pollution = 0.0; - if (Pollution.FuelOil2Coef.PM25Sched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.PM25 * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.PM25 * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.PM25Sched) * 0.001; - } - Pollution.FuelOil2Comp.PM25Pollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.PM25Pollution = 0.0; - if (Pollution.CoalCoef.PM25Sched == 0) { - CoalValue = Pollution.CoalCoef.PM25 * 0.001; - } else { - CoalValue = Pollution.CoalCoef.PM25 * GetCurrentScheduleValue(state, Pollution.CoalCoef.PM25Sched) * 0.001; - } - Pollution.CoalComp.PM25Pollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.PM25Pollution = 0.0; - if (Pollution.GasolineCoef.PM25Sched == 0) { - GasolineValue = Pollution.GasolineCoef.PM25 * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.PM25 * GetCurrentScheduleValue(state, Pollution.GasolineCoef.PM25Sched) * 0.001; - } - Pollution.GasolineComp.PM25Pollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.PM25Pollution = 0.0; - if (Pollution.PropaneCoef.PM25Sched == 0) { - PropaneValue = Pollution.PropaneCoef.PM25 * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.PM25 * GetCurrentScheduleValue(state, Pollution.PropaneCoef.PM25Sched) * 0.001; - } - Pollution.PropaneComp.PM25Pollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.PM25Pollution = 0.0; - if (Pollution.DieselCoef.PM25Sched == 0) { - DieselValue = Pollution.DieselCoef.PM25 * 0.001; - } else { - DieselValue = Pollution.DieselCoef.PM25 * GetCurrentScheduleValue(state, Pollution.DieselCoef.PM25Sched) * 0.001; - } - Pollution.DieselComp.PM25Pollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.PM25Pollution = 0.0; - if (Pollution.OtherFuel1Coef.PM25Sched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.PM25 * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.PM25 * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.PM25Sched) * 0.001; - } - Pollution.OtherFuel1Comp.PM25Pollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.PM25Pollution = 0.0; - if (Pollution.OtherFuel2Coef.PM25Sched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.PM25 * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.PM25 * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.PM25Sched) * 0.001; - } - Pollution.OtherFuel2Comp.PM25Pollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.NH3Pollution = 0.0; - if (Pollution.ElecCoef.NH3Sched == 0) { - ElecValue = Pollution.ElecCoef.NH3 * 0.001; - } else { - ElecValue = Pollution.ElecCoef.NH3 * GetCurrentScheduleValue(state, Pollution.ElecCoef.NH3Sched) * 0.001; - } - Pollution.ElecComp.NH3Pollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.NH3Pollution = 0.0; - if (Pollution.NatGasCoef.NH3Sched == 0) { - NatGasValue = Pollution.NatGasCoef.NH3 * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.NH3 * GetCurrentScheduleValue(state, Pollution.NatGasCoef.NH3Sched) * 0.001; - } - Pollution.NatGasComp.NH3Pollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.NH3Pollution = 0.0; - if (Pollution.FuelOil1Coef.NH3Sched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.NH3 * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.NH3 * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.NH3Sched) * 0.001; - } - Pollution.FuelOil1Comp.NH3Pollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.NH3Pollution = 0.0; - if (Pollution.FuelOil2Coef.NH3Sched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.NH3 * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.NH3 * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.NH3Sched) * 0.001; - } - Pollution.FuelOil2Comp.NH3Pollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.NH3Pollution = 0.0; - if (Pollution.CoalCoef.NH3Sched == 0) { - CoalValue = Pollution.CoalCoef.NH3 * 0.001; - } else { - CoalValue = Pollution.CoalCoef.NH3 * GetCurrentScheduleValue(state, Pollution.CoalCoef.NH3Sched) * 0.001; - } - Pollution.CoalComp.NH3Pollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.NH3Pollution = 0.0; - if (Pollution.GasolineCoef.NH3Sched == 0) { - GasolineValue = Pollution.GasolineCoef.NH3 * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.NH3 * GetCurrentScheduleValue(state, Pollution.GasolineCoef.NH3Sched) * 0.001; - } - Pollution.GasolineComp.NH3Pollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.NH3Pollution = 0.0; - if (Pollution.PropaneCoef.NH3Sched == 0) { - PropaneValue = Pollution.PropaneCoef.NH3 * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.NH3 * GetCurrentScheduleValue(state, Pollution.PropaneCoef.NH3Sched) * 0.001; - } - Pollution.PropaneComp.NH3Pollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.NH3Pollution = 0.0; - if (Pollution.DieselCoef.NH3Sched == 0) { - DieselValue = Pollution.DieselCoef.NH3 * 0.001; - } else { - DieselValue = Pollution.DieselCoef.NH3 * GetCurrentScheduleValue(state, Pollution.DieselCoef.NH3Sched) * 0.001; - } - Pollution.DieselComp.NH3Pollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.NH3Pollution = 0.0; - if (Pollution.OtherFuel1Coef.NH3Sched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.NH3 * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.NH3 * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.NH3Sched) * 0.001; - } - Pollution.OtherFuel1Comp.NH3Pollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.NH3Pollution = 0.0; - if (Pollution.OtherFuel2Coef.NH3Sched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.NH3 * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.NH3 * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.NH3Sched) * 0.001; - } - Pollution.OtherFuel2Comp.NH3Pollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.NMVOCPollution = 0.0; - if (Pollution.ElecCoef.NMVOCSched == 0) { - ElecValue = Pollution.ElecCoef.NMVOC * 0.001; - } else { - ElecValue = Pollution.ElecCoef.NMVOC * GetCurrentScheduleValue(state, Pollution.ElecCoef.NMVOCSched) * 0.001; - } - Pollution.ElecComp.NMVOCPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.NMVOCPollution = 0.0; - if (Pollution.NatGasCoef.NMVOCSched == 0) { - NatGasValue = Pollution.NatGasCoef.NMVOC * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.NMVOC * GetCurrentScheduleValue(state, Pollution.NatGasCoef.NMVOCSched) * 0.001; - } - Pollution.NatGasComp.NMVOCPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.NMVOCPollution = 0.0; - if (Pollution.FuelOil1Coef.NMVOCSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.NMVOC * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.NMVOC * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.NMVOCSched) * 0.001; - } - Pollution.FuelOil1Comp.NMVOCPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.NMVOCPollution = 0.0; - if (Pollution.FuelOil2Coef.NMVOCSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.NMVOC * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.NMVOC * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.NMVOCSched) * 0.001; - } - Pollution.FuelOil2Comp.NMVOCPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.NMVOCPollution = 0.0; - if (Pollution.CoalCoef.NMVOCSched == 0) { - CoalValue = Pollution.CoalCoef.NMVOC * 0.001; - } else { - CoalValue = Pollution.CoalCoef.NMVOC * GetCurrentScheduleValue(state, Pollution.CoalCoef.NMVOCSched) * 0.001; - } - Pollution.CoalComp.NMVOCPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.NMVOCPollution = 0.0; - if (Pollution.GasolineCoef.NMVOCSched == 0) { - GasolineValue = Pollution.GasolineCoef.NMVOC * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.NMVOC * GetCurrentScheduleValue(state, Pollution.GasolineCoef.NMVOCSched) * 0.001; - } - Pollution.GasolineComp.NMVOCPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.NMVOCPollution = 0.0; - if (Pollution.PropaneCoef.NMVOCSched == 0) { - PropaneValue = Pollution.PropaneCoef.NMVOC * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.NMVOC * GetCurrentScheduleValue(state, Pollution.PropaneCoef.NMVOCSched) * 0.001; - } - Pollution.PropaneComp.NMVOCPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.NMVOCPollution = 0.0; - if (Pollution.DieselCoef.NMVOCSched == 0) { - DieselValue = Pollution.DieselCoef.NMVOC * 0.001; - } else { - DieselValue = Pollution.DieselCoef.NMVOC * GetCurrentScheduleValue(state, Pollution.DieselCoef.NMVOCSched) * 0.001; - } - Pollution.DieselComp.NMVOCPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.NMVOCPollution = 0.0; - if (Pollution.OtherFuel1Coef.NMVOCSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.NMVOC * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.NMVOC * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.NMVOCSched) * 0.001; - } - Pollution.OtherFuel1Comp.NMVOCPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.NMVOCPollution = 0.0; - if (Pollution.OtherFuel2Coef.NMVOCSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.NMVOC * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.NMVOC * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.NMVOCSched) * 0.001; - } - Pollution.OtherFuel2Comp.NMVOCPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.HgPollution = 0.0; - if (Pollution.ElecCoef.HgSched == 0) { - ElecValue = Pollution.ElecCoef.Hg * 0.001; - } else { - ElecValue = Pollution.ElecCoef.Hg * GetCurrentScheduleValue(state, Pollution.ElecCoef.HgSched) * 0.001; - } - Pollution.ElecComp.HgPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.HgPollution = 0.0; - if (Pollution.NatGasCoef.HgSched == 0) { - NatGasValue = Pollution.NatGasCoef.Hg * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.Hg * GetCurrentScheduleValue(state, Pollution.NatGasCoef.HgSched) * 0.001; - } - Pollution.NatGasComp.HgPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.HgPollution = 0.0; - if (Pollution.FuelOil1Coef.HgSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.Hg * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.Hg * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.HgSched) * 0.001; - } - Pollution.FuelOil1Comp.HgPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.HgPollution = 0.0; - if (Pollution.FuelOil2Coef.HgSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.Hg * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.Hg * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.HgSched) * 0.001; - } - Pollution.FuelOil2Comp.HgPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.HgPollution = 0.0; - if (Pollution.CoalCoef.HgSched == 0) { - CoalValue = Pollution.CoalCoef.Hg * 0.001; - } else { - CoalValue = Pollution.CoalCoef.Hg * GetCurrentScheduleValue(state, Pollution.CoalCoef.HgSched) * 0.001; - } - Pollution.CoalComp.HgPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.HgPollution = 0.0; - if (Pollution.GasolineCoef.HgSched == 0) { - GasolineValue = Pollution.GasolineCoef.Hg * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.Hg * GetCurrentScheduleValue(state, Pollution.GasolineCoef.HgSched) * 0.001; - } - Pollution.GasolineComp.HgPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.HgPollution = 0.0; - if (Pollution.PropaneCoef.HgSched == 0) { - PropaneValue = Pollution.PropaneCoef.Hg * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.Hg * GetCurrentScheduleValue(state, Pollution.PropaneCoef.HgSched) * 0.001; - } - Pollution.PropaneComp.HgPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.HgPollution = 0.0; - if (Pollution.DieselCoef.HgSched == 0) { - DieselValue = Pollution.DieselCoef.Hg * 0.001; - } else { - DieselValue = Pollution.DieselCoef.Hg * GetCurrentScheduleValue(state, Pollution.DieselCoef.HgSched) * 0.001; } - Pollution.DieselComp.HgPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.HgPollution = 0.0; - if (Pollution.OtherFuel1Coef.HgSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.Hg * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.Hg * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.HgSched) * 0.001; - } - Pollution.OtherFuel1Comp.HgPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.HgPollution = 0.0; - if (Pollution.OtherFuel2Coef.HgSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.Hg * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.Hg * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.HgSched) * 0.001; - } - Pollution.OtherFuel2Comp.HgPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } - - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; + } // End of the NumEnergyTypes Do Loop - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.PbPollution = 0.0; - if (Pollution.ElecCoef.PbSched == 0) { - ElecValue = Pollution.ElecCoef.Pb * 0.001; - } else { - ElecValue = Pollution.ElecCoef.Pb * GetCurrentScheduleValue(state, Pollution.ElecCoef.PbSched) * 0.001; - } - Pollution.ElecComp.PbPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.PbPollution = 0.0; - if (Pollution.NatGasCoef.PbSched == 0) { - NatGasValue = Pollution.NatGasCoef.Pb * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.Pb * GetCurrentScheduleValue(state, Pollution.NatGasCoef.PbSched) * 0.001; - } - Pollution.NatGasComp.PbPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.PbPollution = 0.0; - if (Pollution.FuelOil1Coef.PbSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.Pb * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.Pb * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.PbSched) * 0.001; - } - Pollution.FuelOil1Comp.PbPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.PbPollution = 0.0; - if (Pollution.FuelOil2Coef.PbSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.Pb * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.Pb * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.PbSched) * 0.001; - } - Pollution.FuelOil2Comp.PbPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.PbPollution = 0.0; - if (Pollution.CoalCoef.PbSched == 0) { - CoalValue = Pollution.CoalCoef.Pb * 0.001; - } else { - CoalValue = Pollution.CoalCoef.Pb * GetCurrentScheduleValue(state, Pollution.CoalCoef.PbSched) * 0.001; - } - Pollution.CoalComp.PbPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.PbPollution = 0.0; - if (Pollution.GasolineCoef.PbSched == 0) { - GasolineValue = Pollution.GasolineCoef.Pb * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.Pb * GetCurrentScheduleValue(state, Pollution.GasolineCoef.PbSched) * 0.001; - } - Pollution.GasolineComp.PbPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.PbPollution = 0.0; - if (Pollution.PropaneCoef.PbSched == 0) { - PropaneValue = Pollution.PropaneCoef.Pb * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.Pb * GetCurrentScheduleValue(state, Pollution.PropaneCoef.PbSched) * 0.001; - } - Pollution.PropaneComp.PbPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.PbPollution = 0.0; - if (Pollution.DieselCoef.PbSched == 0) { - DieselValue = Pollution.DieselCoef.Pb * 0.001; - } else { - DieselValue = Pollution.DieselCoef.Pb * GetCurrentScheduleValue(state, Pollution.DieselCoef.PbSched) * 0.001; - } - Pollution.DieselComp.PbPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.PbPollution = 0.0; - if (Pollution.OtherFuel1Coef.PbSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.Pb * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.Pb * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.PbSched) * 0.001; - } - Pollution.OtherFuel1Comp.PbPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.PbPollution = 0.0; - if (Pollution.OtherFuel2Coef.PbSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.Pb * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.Pb * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.PbSched) * 0.001; - } - Pollution.OtherFuel2Comp.PbPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } + // Setup ElectricityPurchased and ElectricitySold variables + SetupOutputVariable(state, + "Environmental Impact Purchased Electricity Source Energy", + OutputProcessor::Unit::J, + pm->pollComps[(int)PollFuelComponent::ElectricityPurchased].sourceVal, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Source", + "PurchasedElectricityEmissions", + {}, + ""); + SetupOutputVariable(state, + "Environmental Impact Surplus Sold Electricity Source", + OutputProcessor::Unit::J, + pm->pollComps[(int)PollFuelComponent::ElectricitySurplusSold].sourceVal, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Source", + "SoldElectricityEmissions", + {}, + ""); - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; + // And Total Carbon Equivalent variables + SetupOutputVariable(state, + "Environmental Impact Total N2O Emissions Carbon Equivalent Mass", + OutputProcessor::Unit::kg, + pm->TotCarbonEquivFromN2O, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Carbon Equivalent", + "CarbonEquivalentEmissions", + {}, + ""); + SetupOutputVariable(state, + "Environmental Impact Total CH4 Emissions Carbon Equivalent Mass", + OutputProcessor::Unit::kg, + pm->TotCarbonEquivFromCH4, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Carbon Equivalent", + "CarbonEquivalentEmissions", + {}, + ""); + SetupOutputVariable(state, + "Environmental Impact Total CO2 Emissions Carbon Equivalent Mass", + OutputProcessor::Unit::kg, + pm->TotCarbonEquivFromCO2, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Carbon Equivalent", + "CarbonEquivalentEmissions", + {}, + ""); +} - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.WaterPollution = 0.0; - if (Pollution.ElecCoef.WaterSched == 0) { - ElecValue = Pollution.ElecCoef.Water; - } else { - ElecValue = Pollution.ElecCoef.Water * GetCurrentScheduleValue(state, Pollution.ElecCoef.WaterSched); - } - Pollution.ElecComp.WaterPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.WaterPollution = 0.0; - if (Pollution.NatGasCoef.WaterSched == 0) { - NatGasValue = Pollution.NatGasCoef.Water; - } else { - NatGasValue = Pollution.NatGasCoef.Water * GetCurrentScheduleValue(state, Pollution.NatGasCoef.WaterSched); - } - Pollution.NatGasComp.WaterPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.WaterPollution = 0.0; - if (Pollution.FuelOil1Coef.WaterSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.Water; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.Water * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.WaterSched); - } - Pollution.FuelOil1Comp.WaterPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.WaterPollution = 0.0; - if (Pollution.FuelOil2Coef.WaterSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.Water; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.Water * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.WaterSched); - } - Pollution.FuelOil2Comp.WaterPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.WaterPollution = 0.0; - if (Pollution.CoalCoef.WaterSched == 0) { - CoalValue = Pollution.CoalCoef.Water; - } else { - CoalValue = Pollution.CoalCoef.Water * GetCurrentScheduleValue(state, Pollution.CoalCoef.WaterSched); - } - Pollution.CoalComp.WaterPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.WaterPollution = 0.0; - if (Pollution.GasolineCoef.WaterSched == 0) { - GasolineValue = Pollution.GasolineCoef.Water; - } else { - GasolineValue = Pollution.GasolineCoef.Water * GetCurrentScheduleValue(state, Pollution.GasolineCoef.WaterSched); - } - Pollution.GasolineComp.WaterPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.WaterPollution = 0.0; - if (Pollution.PropaneCoef.WaterSched == 0) { - PropaneValue = Pollution.PropaneCoef.Water; - } else { - PropaneValue = Pollution.PropaneCoef.Water * GetCurrentScheduleValue(state, Pollution.PropaneCoef.WaterSched); - } - Pollution.PropaneComp.WaterPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.WaterPollution = 0.0; - if (Pollution.DieselCoef.WaterSched == 0) { - DieselValue = Pollution.DieselCoef.Water; - } else { - DieselValue = Pollution.DieselCoef.Water * GetCurrentScheduleValue(state, Pollution.DieselCoef.WaterSched); - } - Pollution.DieselComp.WaterPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.WaterPollution = 0.0; - if (Pollution.OtherFuel1Coef.WaterSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.Water; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.Water * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.WaterSched); - } - Pollution.OtherFuel1Comp.WaterPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.WaterPollution = 0.0; - if (Pollution.OtherFuel2Coef.WaterSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.Water; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.Water * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.WaterSched); - } - Pollution.OtherFuel2Comp.WaterPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } +void CheckPollutionMeterReporting(EnergyPlusData &state) +{ - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; + // SUBROUTINE INFORMATION: + // AUTHOR Linda Lawrie + // DATE WRITTEN October 2008 - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.NucHiPollution = 0.0; - if (Pollution.ElecCoef.NucHiSched == 0) { - ElecValue = Pollution.ElecCoef.NucHi * 0.001; - } else { - ElecValue = Pollution.ElecCoef.NucHi * GetCurrentScheduleValue(state, Pollution.ElecCoef.NucHiSched) * 0.001; - } - Pollution.ElecComp.NucHiPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.NucHiPollution = 0.0; - if (Pollution.NatGasCoef.NucHiSched == 0) { - NatGasValue = Pollution.NatGasCoef.NucHi * 0.001; - } else { - NatGasValue = Pollution.NatGasCoef.NucHi * GetCurrentScheduleValue(state, Pollution.NatGasCoef.NucHiSched) * 0.001; - } - Pollution.NatGasComp.NucHiPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.NucHiPollution = 0.0; - if (Pollution.FuelOil1Coef.NucHiSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.NucHi * 0.001; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.NucHi * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.NucHiSched) * 0.001; - } - Pollution.FuelOil1Comp.NucHiPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.NucHiPollution = 0.0; - if (Pollution.FuelOil2Coef.NucHiSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.NucHi * 0.001; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.NucHi * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.NucHiSched) * 0.001; - } - Pollution.FuelOil2Comp.NucHiPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.NucHiPollution = 0.0; - if (Pollution.CoalCoef.NucHiSched == 0) { - CoalValue = Pollution.CoalCoef.NucHi * 0.001; - } else { - CoalValue = Pollution.CoalCoef.NucHi * GetCurrentScheduleValue(state, Pollution.CoalCoef.NucHiSched) * 0.001; - } - Pollution.CoalComp.NucHiPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.NucHiPollution = 0.0; - if (Pollution.GasolineCoef.NucHiSched == 0) { - GasolineValue = Pollution.GasolineCoef.NucHi * 0.001; - } else { - GasolineValue = Pollution.GasolineCoef.NucHi * GetCurrentScheduleValue(state, Pollution.GasolineCoef.NucHiSched) * 0.001; - } - Pollution.GasolineComp.NucHiPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.NucHiPollution = 0.0; - if (Pollution.PropaneCoef.NucHiSched == 0) { - PropaneValue = Pollution.PropaneCoef.NucHi * 0.001; - } else { - PropaneValue = Pollution.PropaneCoef.NucHi * GetCurrentScheduleValue(state, Pollution.PropaneCoef.NucHiSched) * 0.001; - } - Pollution.PropaneComp.NucHiPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.NucHiPollution = 0.0; - if (Pollution.DieselCoef.NucHiSched == 0) { - DieselValue = Pollution.DieselCoef.NucHi * 0.001; - } else { - DieselValue = Pollution.DieselCoef.NucHi * GetCurrentScheduleValue(state, Pollution.DieselCoef.NucHiSched) * 0.001; - } - Pollution.DieselComp.NucHiPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.NucHiPollution = 0.0; - if (Pollution.OtherFuel1Coef.NucHiSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.NucHi * 0.001; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.NucHi * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.NucHiSched) * 0.001; - } - Pollution.OtherFuel1Comp.NucHiPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.NucHiPollution = 0.0; - if (Pollution.OtherFuel2Coef.NucHiSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.NucHi * 0.001; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.NucHi * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.NucHiSched) * 0.001; + // in progress (what is in progress?) + + auto &pm = state.dataPollution; + + if (pm->NumFuelFactors == 0 || pm->NumEnvImpactFactors == 0) { + if (ReportingThisVariable(state, "Environmental Impact Total N2O Emissions Carbon Equivalent Mass") || + ReportingThisVariable(state, "Environmental Impact Total CH4 Emissions Carbon Equivalent Mass") || + ReportingThisVariable(state, "Environmental Impact Total CO2 Emissions Carbon Equivalent Mass") || + ReportingThisVariable(state, "Carbon Equivalent:Facility") || + ReportingThisVariable(state, "CarbonEquivalentEmissions:Carbon Equivalent")) { + ShowWarningError( + state, "GetPollutionFactorInput: Requested reporting for Carbon Equivalent Pollution, but insufficient information is entered."); + ShowContinueError( + state, "(Both \"FuelFactors\" and \"EnvironmentalImpactFactors\" must be entered or the displayed carbon pollution will all be zero.)"); } - Pollution.OtherFuel2Comp.NucHiPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; } +} - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; - if (Pollution.ElecCoef.FuelFactorUsed) { - Pollution.ElecComp.NucLoPollution = 0.0; - if (Pollution.ElecCoef.NucLoSched == 0) { - ElecValue = Pollution.ElecCoef.NucLo; - } else { - ElecValue = Pollution.ElecCoef.NucLo * GetCurrentScheduleValue(state, Pollution.ElecCoef.NucLoSched); - } - Pollution.ElecComp.NucLoPollution = (FuelType.Elec * 1.0e-6) * ElecValue; - } - if (Pollution.NatGasCoef.FuelFactorUsed) { - Pollution.NatGasComp.NucLoPollution = 0.0; - if (Pollution.NatGasCoef.NucLoSched == 0) { - NatGasValue = Pollution.NatGasCoef.NucLo; - } else { - NatGasValue = Pollution.NatGasCoef.NucLo * GetCurrentScheduleValue(state, Pollution.NatGasCoef.NucLoSched); - } - Pollution.NatGasComp.NucLoPollution = (FuelType.NatGas * 1.0e-6) * NatGasValue; - } - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - Pollution.FuelOil1Comp.NucLoPollution = 0.0; - if (Pollution.FuelOil1Coef.NucLoSched == 0) { - FuelOil1Value = Pollution.FuelOil1Coef.NucLo; - } else { - FuelOil1Value = Pollution.FuelOil1Coef.NucLo * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.NucLoSched); - } - Pollution.FuelOil1Comp.NucLoPollution = (FuelType.FuelOil1 * 1.0e-6) * FuelOil1Value; - } - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - Pollution.FuelOil2Comp.NucLoPollution = 0.0; - if (Pollution.FuelOil2Coef.NucLoSched == 0) { - FuelOil2Value = Pollution.FuelOil2Coef.NucLo; - } else { - FuelOil2Value = Pollution.FuelOil2Coef.NucLo * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.NucLoSched); - } - Pollution.FuelOil2Comp.NucLoPollution = (FuelType.FuelOil2 * 1.0e-6) * FuelOil2Value; - } - if (Pollution.CoalCoef.FuelFactorUsed) { - Pollution.CoalComp.NucLoPollution = 0.0; - if (Pollution.CoalCoef.NucLoSched == 0) { - CoalValue = Pollution.CoalCoef.NucLo; - } else { - CoalValue = Pollution.CoalCoef.NucLo * GetCurrentScheduleValue(state, Pollution.CoalCoef.NucLoSched); - } - Pollution.CoalComp.NucLoPollution = (FuelType.Coal * 1.0e-6) * CoalValue; - } - if (Pollution.GasolineCoef.FuelFactorUsed) { - Pollution.GasolineComp.NucLoPollution = 0.0; - if (Pollution.GasolineCoef.NucLoSched == 0) { - GasolineValue = Pollution.GasolineCoef.NucLo; - } else { - GasolineValue = Pollution.GasolineCoef.NucLo * GetCurrentScheduleValue(state, Pollution.GasolineCoef.NucLoSched); - } - Pollution.GasolineComp.NucLoPollution = (FuelType.Gasoline * 1.0e-6) * GasolineValue; - } - if (Pollution.PropaneCoef.FuelFactorUsed) { - Pollution.PropaneComp.NucLoPollution = 0.0; - if (Pollution.PropaneCoef.NucLoSched == 0) { - PropaneValue = Pollution.PropaneCoef.NucLo; - } else { - PropaneValue = Pollution.PropaneCoef.NucLo * GetCurrentScheduleValue(state, Pollution.PropaneCoef.NucLoSched); - } - Pollution.PropaneComp.NucLoPollution = (FuelType.Propane * 1.0e-6) * PropaneValue; - } - if (Pollution.DieselCoef.FuelFactorUsed) { - Pollution.DieselComp.NucLoPollution = 0.0; - if (Pollution.DieselCoef.NucLoSched == 0) { - DieselValue = Pollution.DieselCoef.NucLo; - } else { - DieselValue = Pollution.DieselCoef.NucLo * GetCurrentScheduleValue(state, Pollution.DieselCoef.NucLoSched); - } - Pollution.DieselComp.NucLoPollution = (FuelType.Diesel * 1.0e-6) * DieselValue; - } - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - Pollution.OtherFuel1Comp.NucLoPollution = 0.0; - if (Pollution.OtherFuel1Coef.NucLoSched == 0) { - OtherFuel1Value = Pollution.OtherFuel1Coef.NucLo; - } else { - OtherFuel1Value = Pollution.OtherFuel1Coef.NucLo * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.NucLoSched); - } - Pollution.OtherFuel1Comp.NucLoPollution = (FuelType.OtherFuel1 * 1.0e-6) * OtherFuel1Value; - } - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - Pollution.OtherFuel2Comp.NucLoPollution = 0.0; - if (Pollution.OtherFuel2Coef.NucLoSched == 0) { - OtherFuel2Value = Pollution.OtherFuel2Coef.NucLo; - } else { - OtherFuel2Value = Pollution.OtherFuel2Coef.NucLo * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.NucLoSched); - } - Pollution.OtherFuel2Comp.NucLoPollution = (FuelType.OtherFuel2 * 1.0e-6) * OtherFuel2Value; - } +// End of Get Input subroutines for the Pollution Module +//****************************************************************************** - Pollution.TotCarbonEquivFromN2O = Pollution.N2OPollutTotal * Pollution.CarbonEquivN2O; - Pollution.TotCarbonEquivFromCH4 = Pollution.CH4PollutTotal * Pollution.CarbonEquivCH4; - Pollution.TotCarbonEquivFromCO2 = Pollution.CO2PollutTotal * Pollution.CarbonEquivCO2; +void CalcPollution(EnergyPlusData &state) +{ + // SUBROUTINE INFORMATION: + // AUTHOR Richard Liesen + // DATE WRITTEN 1998 + // MODIFIED na + // RE-ENGINEERED December 2003 RJL - ElecValue = 0.0; - NatGasValue = 0.0; - FuelOil1Value = 0.0; - FuelOil2Value = 0.0; - CoalValue = 0.0; - GasolineValue = 0.0; - PropaneValue = 0.0; - DieselValue = 0.0; - OtherFuel1Value = 0.0; - OtherFuel2Value = 0.0; + // Then the amount of Pollution produced by each fuel type is + // calculated in kgs. + // Input units for the coefficients is not standard and needs to be converted here. + // Most of the units are g/MJ, however water is in L/MJ and low level nuclear water is m3/MJ + // so only the energy has to be converted from J to MJ. - if (Pollution.ElecCoef.SourceSched != 0) { - Pollution.ElecComp.Source = FuelType.Elec * Pollution.ElecCoef.Source * GetCurrentScheduleValue(state, Pollution.ElecCoef.SourceSched); - Pollution.ElecPurchComp.Source = - FuelType.ElecPurch * Pollution.ElecCoef.Source * GetCurrentScheduleValue(state, Pollution.ElecCoef.SourceSched); - Pollution.ElecSurplusSoldComp.Source = - FuelType.ElecSold * Pollution.ElecCoef.Source * GetCurrentScheduleValue(state, Pollution.ElecCoef.SourceSched); - } else { - Pollution.ElecComp.Source = FuelType.Elec * Pollution.ElecCoef.Source; - Pollution.ElecPurchComp.Source = FuelType.ElecPurch * Pollution.ElecCoef.Source; - Pollution.ElecSurplusSoldComp.Source = FuelType.ElecSold * Pollution.ElecCoef.Source; - } - if (Pollution.NatGasCoef.SourceSched != 0) { - // does not include district heating or steam - Pollution.NatGasComp.Source = - FuelType.NatGasFacility * Pollution.NatGasCoef.Source * GetCurrentScheduleValue(state, Pollution.NatGasCoef.SourceSched); - } else { - Pollution.NatGasComp.Source = FuelType.NatGasFacility * Pollution.NatGasCoef.Source; - } - if (Pollution.FuelOil1Coef.SourceSched != 0) { - Pollution.FuelOil1Comp.Source = - FuelType.FuelOil1 * Pollution.FuelOil1Coef.Source * GetCurrentScheduleValue(state, Pollution.FuelOil1Coef.SourceSched); - } else { - Pollution.FuelOil1Comp.Source = FuelType.FuelOil1 * Pollution.FuelOil1Coef.Source; - } - if (Pollution.FuelOil2Coef.SourceSched != 0) { - Pollution.FuelOil2Comp.Source = - FuelType.FuelOil2 * Pollution.FuelOil2Coef.Source * GetCurrentScheduleValue(state, Pollution.FuelOil2Coef.SourceSched); - } else { - Pollution.FuelOil1Comp.Source = FuelType.FuelOil2 * Pollution.FuelOil2Coef.Source; - } - if (Pollution.CoalCoef.SourceSched != 0) { - Pollution.CoalComp.Source = FuelType.Coal * Pollution.CoalCoef.Source * GetCurrentScheduleValue(state, Pollution.CoalCoef.SourceSched); - } else { - Pollution.CoalComp.Source = FuelType.Coal * Pollution.CoalCoef.Source; - } - if (Pollution.GasolineCoef.SourceSched != 0) { - Pollution.GasolineComp.Source = - FuelType.Gasoline * Pollution.GasolineCoef.Source * GetCurrentScheduleValue(state, Pollution.GasolineCoef.SourceSched); - } else { - Pollution.GasolineComp.Source = FuelType.Gasoline * Pollution.GasolineCoef.Source; - } - if (Pollution.PropaneCoef.SourceSched != 0) { - Pollution.PropaneComp.Source = - FuelType.Propane * Pollution.PropaneCoef.Source * GetCurrentScheduleValue(state, Pollution.PropaneCoef.SourceSched); - } else { - Pollution.PropaneComp.Source = FuelType.Propane * Pollution.PropaneCoef.Source; - } - if (Pollution.DieselCoef.SourceSched != 0) { - Pollution.DieselComp.Source = - FuelType.Diesel * Pollution.DieselCoef.Source * GetCurrentScheduleValue(state, Pollution.DieselCoef.SourceSched); - } else { - Pollution.DieselComp.Source = FuelType.Diesel * Pollution.DieselCoef.Source; - } - if (Pollution.OtherFuel1Coef.SourceSched != 0) { - Pollution.OtherFuel1Comp.Source = - FuelType.OtherFuel1 * Pollution.OtherFuel1Coef.Source * GetCurrentScheduleValue(state, Pollution.OtherFuel1Coef.SourceSched); - } else { - Pollution.OtherFuel1Comp.Source = FuelType.OtherFuel1 * Pollution.OtherFuel1Coef.Source; - } - if (Pollution.OtherFuel2Coef.SourceSched != 0) { - Pollution.OtherFuel2Comp.Source = - FuelType.OtherFuel2 * Pollution.OtherFuel2Coef.Source * GetCurrentScheduleValue(state, Pollution.OtherFuel2Coef.SourceSched); - } else { - Pollution.OtherFuel2Comp.Source = FuelType.OtherFuel2 * Pollution.OtherFuel2Coef.Source; - } -} + // For each pollution/fuel type, Schedule values are allowed. Thus, calculations are bundled. + auto &pm = state.dataPollution; + + for (int iPoll = 0; iPoll < (int)Constant::ePollutant::Num; ++iPoll) { + for (int iPollFuel = 0; iPollFuel < (int)PollFuel::Num; ++iPollFuel) { + auto &pollCoeff = pm->pollCoeffs[iPollFuel]; + auto &pollComp = pm->pollComps[(int)pollFuel2pollFuelComponent[iPollFuel]]; + + if (pollCoeff.used) { + pollComp.pollutantVals[iPoll] = 0.0; + Real64 pollutantVal = pollCoeff.pollutantCoeffs[iPoll] * 0.001; + if (pollCoeff.pollutantSchedNums[iPoll] != 0) { + pollutantVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.pollutantSchedNums[iPoll]); + } + pollComp.pollutantVals[iPoll] = + pm->facilityMeterFuelComponentVals[(int)pollFuel2pollFuelComponent[iPollFuel]] * 1.0e-6 * pollutantVal; + } + + pm->pollutantVals[iPoll] += pollComp.pollutantVals[iPoll]; + } // for (iPollFactor) + } // for (iPoll) + + auto const &pollCoeffElec = pm->pollCoeffs[(int)PollFuel::Electricity]; + auto &pollCompElec = pm->pollComps[(int)PollFuelComponent::Electricity]; + auto &pollCompElecPurchased = pm->pollComps[(int)PollFuelComponent::ElectricityPurchased]; + auto &pollCompElecSurplusSold = pm->pollComps[(int)PollFuelComponent::ElectricitySurplusSold]; + + pollCompElec.sourceVal = pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] * pollCoeffElec.sourceCoeff; + pollCompElecPurchased.sourceVal = pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricityPurchased] * pollCoeffElec.sourceCoeff; + pollCompElecSurplusSold.sourceVal = pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricitySurplusSold] * pollCoeffElec.sourceCoeff; + + if (pollCoeffElec.sourceSchedNum != 0) { + Real64 pollCoeffElecSchedVal = ScheduleManager::GetCurrentScheduleValue(state, pollCoeffElec.sourceSchedNum); + pollCompElec.sourceVal *= pollCoeffElecSchedVal; + pollCompElecPurchased.sourceVal *= pollCoeffElecSchedVal; + pollCompElecSurplusSold.sourceVal *= pollCoeffElecSchedVal; + } + + // does not include district heating or steam + auto const &pollCoeff = pm->pollCoeffs[(int)PollFuel::NaturalGas]; + auto &pollComp = pm->pollComps[(int)PollFuelComponent::NaturalGas]; + pollComp.sourceVal = pm->facilityMeterVals[(int)PollFacilityMeter::NaturalGas] * pollCoeff.sourceCoeff; + if (pollCoeff.sourceSchedNum != 0) { + pollComp.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.sourceSchedNum); + } + + for (PollFuel pollFuel : {PollFuel::FuelOil1, PollFuel::FuelOil2, PollFuel::Diesel, PollFuel::Gasoline, + PollFuel::Propane, PollFuel::Coal, PollFuel::OtherFuel1, PollFuel::OtherFuel2}) { + auto const &pollCoeff = pm->pollCoeffs[(int)pollFuel]; + PollFuelComponent pollFuelComponent = pollFuel2pollFuelComponent[(int)pollFuel]; + auto &pollComp = pm->pollComps[(int)pollFuelComponent]; + + pollComp.sourceVal = pm->facilityMeterFuelComponentVals[(int)pollFuelComponent] * pollCoeff.sourceCoeff; + if (pollCoeff.sourceSchedNum != 0) { + pollComp.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.sourceSchedNum); + } + } // for (pollFuelComponent) +} // CalcPollution() void ReadEnergyMeters(EnergyPlusData &state) { @@ -6195,91 +642,44 @@ void ReadEnergyMeters(EnergyPlusData &state) // Using/Aliasing Real64 FracTimeStepZone = state.dataHVACGlobal->FracTimeStepZone; - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - auto &Pollution = state.dataPollutionModule->Pollution; - auto &FuelType = state.dataPollutionModule->FuelType; - - FuelType.ElecFacility = GetInstantMeterValue(state, FuelType.ElecFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.ElecFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.DieselFacility = GetInstantMeterValue(state, FuelType.DieselFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.DieselFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.PurchCoolFacility = - GetInstantMeterValue(state, FuelType.PurchCoolFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.PurchCoolFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.PurchHeatFacility = - GetInstantMeterValue(state, FuelType.PurchHeatFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.PurchHeatFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.NatGasFacility = GetInstantMeterValue(state, FuelType.NatGasFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.NatGasFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.GasolineFacility = GetInstantMeterValue(state, FuelType.GasolineFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.GasolineFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.CoalFacility = GetInstantMeterValue(state, FuelType.CoalFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.CoalFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.FuelOil1Facility = GetInstantMeterValue(state, FuelType.FuelOil1FacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.FuelOil1FacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.FuelOil2Facility = GetInstantMeterValue(state, FuelType.FuelOil2FacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.FuelOil2FacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.PropaneFacility = GetInstantMeterValue(state, FuelType.PropaneFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.PropaneFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.OtherFuel1Facility = - GetInstantMeterValue(state, FuelType.OtherFuel1FacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.OtherFuel1FacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.OtherFuel2Facility = - GetInstantMeterValue(state, FuelType.OtherFuel2FacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.OtherFuel2FacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.ElecProducedFacility = - GetInstantMeterValue(state, FuelType.ElecProducedFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.ElecProducedFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.SteamFacility = GetInstantMeterValue(state, FuelType.SteamFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.SteamFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.ElecPurchasedFacility = - GetInstantMeterValue(state, FuelType.ElecPurchasedFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.ElecPurchasedFacilityIndex, OutputProcessor::TimeStepType::System); - FuelType.ElecSurplusSoldFacility = - GetInstantMeterValue(state, FuelType.ElecSurplusSoldFacilityIndex, OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + - GetInstantMeterValue(state, FuelType.ElecSurplusSoldFacilityIndex, OutputProcessor::TimeStepType::System); - + auto &pm = state.dataPollution; + + for (int iMeter = 0; iMeter < (int)PollFacilityMeter::Num; ++iMeter) { + pm->facilityMeterVals[iMeter] = + GetInstantMeterValue(state, pm->facilityMeterNums[iMeter], OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + + GetInstantMeterValue(state, pm->facilityMeterNums[iMeter], OutputProcessor::TimeStepType::System); + } // Now these fuel types have to be sorted and summed into categories that we have pollution factors for. // The Off-Site Electricity is the total needed by the facility minus the amount generated on-site. // The on-site pollutants will end up being other fuel types used by the generators. // If the difference between the 2 electric quantities is <0.0 then it will be zero for that time step. // We will also add the District Cooling here with a rough conversion from Energy using the User // defined COP. - FuelType.Elec = FuelType.ElecFacility - FuelType.ElecProducedFacility + FuelType.PurchCoolFacility / Pollution.PurchCoolCOP; - if (FuelType.Elec <= 0.0) FuelType.Elec = 0.0; - - // The Natural Gas fuel type will be summed from the meters with the District Heating using an efficiency. - FuelType.NatGas = - FuelType.NatGasFacility + FuelType.PurchHeatFacility / Pollution.PurchHeatEffic + FuelType.SteamFacility / Pollution.SteamConvEffic; - - // The Distillate Oil or Fuel Oil #1 - FuelType.FuelOil1 = FuelType.FuelOil1Facility; - - // The Residual Oil or Fuel Oil #2 - FuelType.FuelOil2 = FuelType.FuelOil2Facility; - - // The Gasoline fuel type will be summed - FuelType.Gasoline = FuelType.GasolineFacility; - - // The Natural Gas fuel type will be summed with the Nat gas and Propane fuel types from the meters and the Purchased - FuelType.Propane = FuelType.PropaneFacility; - - // The Coal fuel type will be assigned Coal - FuelType.Coal = FuelType.CoalFacility; - - // The Diesel fuel type will be summed - FuelType.Diesel = FuelType.DieselFacility; - - // The OtherFuel1 fuel type will be summed - FuelType.OtherFuel1 = FuelType.OtherFuel1Facility; - // The OtherFuel2 fuel type will be summed - FuelType.OtherFuel2 = FuelType.OtherFuel2Facility; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] = + pm->facilityMeterVals[(int)PollFacilityMeter::Electricity] - + pm->facilityMeterVals[(int)PollFacilityMeter::ElectricityProduced] + + pm->facilityMeterVals[(int)PollFacilityMeter::CoolPurchased] / pm->PurchCoolCOP; - FuelType.ElecPurch = FuelType.ElecPurchasedFacility; + if (pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] < 0.0) + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] = 0.0; - FuelType.ElecSold = FuelType.ElecSurplusSoldFacility; + // The Natural Gas fuel type will be summed from the meters with the District Heating using an efficiency. + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::NaturalGas] = + pm->facilityMeterVals[(int)PollFacilityMeter::NaturalGas] + + pm->facilityMeterVals[(int)PollFacilityMeter::HeatPurchased] / pm->PurchHeatEffic + + pm->facilityMeterVals[(int)PollFacilityMeter::Steam] / pm->SteamConvEffic; + + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::FuelOil1] = pm->facilityMeterVals[(int)PollFacilityMeter::FuelOil1]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::FuelOil2] = pm->facilityMeterVals[(int)PollFacilityMeter::FuelOil2]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Gasoline] = pm->facilityMeterVals[(int)PollFacilityMeter::Gasoline]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Propane] = pm->facilityMeterVals[(int)PollFacilityMeter::Propane]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Coal] = pm->facilityMeterVals[(int)PollFacilityMeter::Coal]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Diesel] = pm->facilityMeterVals[(int)PollFacilityMeter::Diesel]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::OtherFuel1] = pm->facilityMeterVals[(int)PollFacilityMeter::OtherFuel1]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::OtherFuel2] = pm->facilityMeterVals[(int)PollFacilityMeter::OtherFuel2]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricityPurchased] = pm->facilityMeterVals[(int)PollFacilityMeter::ElectricityPurchased]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricitySurplusSold] = pm->facilityMeterVals[(int)PollFacilityMeter::ElectricitySurplusSold]; } // ***************************************************************************** @@ -6287,7 +687,7 @@ void ReadEnergyMeters(EnergyPlusData &state) // ***************************************************************************** void GetFuelFactorInfo(EnergyPlusData &state, - Constant::eFuel const &fuelName, // input fuel name (standard from Tabular reports) + Constant::eFuel fuel, // input fuel name (standard from Tabular reports) bool &fuelFactorUsed, // return value true if user has entered this fuel Real64 &fuelSourceFactor, // if used, the source factor bool &fuelFactorScheduleUsed, // if true, schedules for this fuel are used @@ -6298,222 +698,44 @@ void GetFuelFactorInfo(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN July 2008 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This routine allows access to data inside this module from other modules (specifically the // output tabular reports. - - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // na - - if (state.dataPollutionModule->GetInputFlagPollution) { + auto &pm = state.dataPollution; + + if (pm->GetInputFlagPollution) { GetPollutionFactorInput(state); - state.dataPollutionModule->GetInputFlagPollution = false; + pm->GetInputFlagPollution = false; } - auto &Pollution = state.dataPollutionModule->Pollution; fuelFactorUsed = false; fuelSourceFactor = 0.0; fuelFactorScheduleUsed = false; ffScheduleIndex = 0; - switch (fuelName) { - case Constant::eFuel::NaturalGas: { - if (Pollution.NatGasCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.NatGasCoef.Source; - if (Pollution.NatGasCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.NatGasCoef.SourceSched; - } - } else { - fuelSourceFactor = 1.084; - } - } break; - case Constant::eFuel::Electricity: { - if (Pollution.ElecCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.ElecCoef.Source; - if (Pollution.ElecCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.ElecCoef.SourceSched; - } - } else { - fuelSourceFactor = 3.167; - } - } break; - case Constant::eFuel::FuelOilNo2: { - if (Pollution.FuelOil2Coef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.FuelOil2Coef.Source; - if (Pollution.FuelOil2Coef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.FuelOil2Coef.SourceSched; - } - } else { - fuelSourceFactor = 1.05; - } - } break; - case Constant::eFuel::FuelOilNo1: { - if (Pollution.FuelOil1Coef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.FuelOil1Coef.Source; - if (Pollution.FuelOil1Coef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.FuelOil1Coef.SourceSched; - } - } else { - fuelSourceFactor = 1.05; - } - } break; - case Constant::eFuel::Coal: { - if (Pollution.CoalCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.CoalCoef.Source; - if (Pollution.CoalCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.CoalCoef.SourceSched; - } - } else { - fuelSourceFactor = 1.05; - } - } break; - case Constant::eFuel::Gasoline: { - if (Pollution.GasolineCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.GasolineCoef.Source; - if (Pollution.GasolineCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.GasolineCoef.SourceSched; - } - } else { - fuelSourceFactor = 1.05; - } - } break; - case Constant::eFuel::Propane: { - if (Pollution.PropaneCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.PropaneCoef.Source; - if (Pollution.PropaneCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.PropaneCoef.SourceSched; - } - } else { - fuelSourceFactor = 1.05; - } - } break; - case Constant::eFuel::Diesel: { - if (Pollution.DieselCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.DieselCoef.Source; - if (Pollution.DieselCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.DieselCoef.SourceSched; - } - } else { - fuelSourceFactor = 1.05; - } - } break; - case Constant::eFuel::OtherFuel1: { - if (Pollution.OtherFuel1Coef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.OtherFuel1Coef.Source; - if (Pollution.OtherFuel1Coef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.OtherFuel1Coef.SourceSched; - } - } else { - fuelSourceFactor = 1.0; - } - } break; - case Constant::eFuel::OtherFuel2: { - if (Pollution.OtherFuel2Coef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.OtherFuel2Coef.Source; - if (Pollution.OtherFuel2Coef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.OtherFuel2Coef.SourceSched; - } - } else { - fuelSourceFactor = 1.0; - } - } break; - case Constant::eFuel::DistrictHeating: { - if (Pollution.NatGasCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.NatGasCoef.Source / Pollution.PurchHeatEffic; - if (Pollution.NatGasCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.NatGasCoef.SourceSched; - } + PollFuel pollFuel = fuel2pollFuel[(int)fuel]; + auto const &pollCoeff = pm->pollCoeffs[(int)pollFuel]; + + if (pollCoeff.used) { + fuelFactorUsed = true; + fuelSourceFactor = pollCoeff.sourceCoeff; + if (pollCoeff.sourceSchedNum == 0) { + fuelFactorScheduleUsed = false; } else { - fuelSourceFactor = 1.084 / Pollution.PurchHeatEffic; + fuelFactorScheduleUsed = true; + ffScheduleIndex = pollCoeff.sourceSchedNum; } - } break; - case Constant::eFuel::DistrictCooling: { - if (Pollution.ElecCoef.FuelFactorUsed) { - fuelFactorUsed = true; - fuelSourceFactor = Pollution.ElecCoef.Source / Pollution.PurchCoolCOP; - if (Pollution.ElecCoef.SourceSched == 0) { - fuelFactorScheduleUsed = false; - } else { - fuelFactorScheduleUsed = true; - ffScheduleIndex = Pollution.ElecCoef.SourceSched; - } - } else { - fuelSourceFactor = 3.167 / Pollution.PurchCoolCOP; - } - } break; - case Constant::eFuel::Steam: { - fuelSourceFactor = 0.3 / Pollution.SteamConvEffic; - } break; - default: { - } break; + } else { + fuelSourceFactor = pollFuelFactors[(int)pollFuel]; + } + + if (fuel == Constant::eFuel::DistrictHeating) { + fuelSourceFactor /= pm->PurchHeatEffic; + } else if (fuel == Constant::eFuel::DistrictCooling) { + fuelSourceFactor /= pm->PurchCoolCOP; + } else if (fuel == Constant::eFuel::Steam) { + fuelSourceFactor = 0.3 / pm->SteamConvEffic; } } @@ -6527,35 +749,21 @@ void GetEnvironmentalImpactFactorInfo(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN August 2008 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This routine allows access to data inside this module from other modules (specifically the // output tabular reports. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // Each of the arguments must be entered in the EnvironmentalImpactFactors object - - if (state.dataPollutionModule->GetInputFlagPollution) { + auto &pm = state.dataPollution; + if (pm->GetInputFlagPollution) { GetPollutionFactorInput(state); - state.dataPollutionModule->GetInputFlagPollution = false; + pm->GetInputFlagPollution = false; } - if (state.dataPollutionModule->NumEnvImpactFactors > 0) { - efficiencyDistrictHeating = state.dataPollutionModule->Pollution.PurchHeatEffic; - efficiencyDistrictCooling = state.dataPollutionModule->Pollution.PurchCoolCOP; - sourceFactorSteam = state.dataPollutionModule->Pollution.SteamConvEffic; + if (pm->NumEnvImpactFactors > 0) { + efficiencyDistrictHeating = pm->PurchHeatEffic; + efficiencyDistrictCooling = pm->PurchCoolCOP; + sourceFactorSteam = pm->SteamConvEffic; } } diff --git a/src/EnergyPlus/PollutionModule.hh b/src/EnergyPlus/PollutionModule.hh index 0cc471e1c4d..7d6c4c26886 100644 --- a/src/EnergyPlus/PollutionModule.hh +++ b/src/EnergyPlus/PollutionModule.hh @@ -59,13 +59,78 @@ namespace EnergyPlus { -namespace PollutionModule { +namespace Pollution { - enum class PollFactor + // This is very similar to ePollutant in DataGlobalConstants, but + // also includes water. Water is a pollutant? Really? + enum class Pollutant2 { Invalid = -1, - Elec, - NatGas, + CO2, + CO, + CH4, + NOx, + N2O, + SO2, + PM, + PM10, + PM2_5, + NH3, + NMVOC, + Hg, + Pb, + Water, + NuclearHigh, + NuclearLow, + Num + }; + + constexpr std::array poll2Names = { + "CO2", "CO", "CH4", "NOx", "N2O", "SO2", "PM", "PM10", "PM2.5", "NH3", "NMVOC", "Hg", "Pb", "WaterEnvironmentalFactors", "Nuclear High", "Nuclear Low"}; + + constexpr std::array poll2Units = { + OutputProcessor::Unit::kg, // CO2 + OutputProcessor::Unit::kg, // CO + OutputProcessor::Unit::kg, // CH4 + OutputProcessor::Unit::kg, // NOx + OutputProcessor::Unit::kg, // N2O + OutputProcessor::Unit::kg, // SO2 + OutputProcessor::Unit::kg, // PM + OutputProcessor::Unit::kg, // PM10 + OutputProcessor::Unit::kg, // PM2_5 + OutputProcessor::Unit::kg, // NH3 + OutputProcessor::Unit::kg, // NMVOC + OutputProcessor::Unit::kg, // Hg + OutputProcessor::Unit::kg, // Pb + OutputProcessor::Unit::L, // Water + OutputProcessor::Unit::kg, // NuclearHigh + OutputProcessor::Unit::m3, // NuclearLow + }; + + constexpr std::array poll2outVarStrs = { + "CO2 Emissions Mass", // CO2 + "CO Emissions Mass", // CO + "CH4 Emissions Mass", // CH4 + "NOx Emissions Mass", // NOx + "N2O Emissions Mass", // N2O + "SO2 Emissions Mass", // SO2 + "PM Emissions Mass", // PM + "PM10 Emissions Mass", // PM10 + "PM2.5 Emissions Mass", // PM2_5 + "NH3 Emissions Mass", // NH3 + "NMVOC Emissions Mass", // NMVOC + "Hg Emissions Mass", // Hg + "Pb Emissions Mass", // Pb + "Water Consumption Volume", // Water + "Nuclear High Level Waste Mass", // NuclearHigh + "Nuclear Low Level Waste Volume", // NuclearLow + }; + + enum class PollFuel + { + Invalid = -1, + Electricity, + NaturalGas, FuelOil1, FuelOil2, Coal, @@ -77,335 +142,147 @@ namespace PollutionModule { Num }; - // MODULE VARIABLE DECLARATIONS: - // Total for all of the Pollutants - // Total Carbon Equivalent Components - // !Fuel Types - // Total Carbon Equivalent Coeffs - // Purchased Efficiencies - - // Fuel Types used with the Pollution Factors - // Facility Meter Indexes - // Facility Meter Values used in Pollution Calcs - - struct ComponentProps - { - // Members - int FuelFactorType; - Real64 Source; - Real64 CO2Pollution; - Real64 COPollution; - Real64 CH4Pollution; - Real64 NOxPollution; - Real64 N2OPollution; - Real64 SO2Pollution; - Real64 PMPollution; - Real64 PM10Pollution; - Real64 PM25Pollution; - Real64 NH3Pollution; - Real64 NMVOCPollution; - Real64 HgPollution; - Real64 PbPollution; - Real64 WaterPollution; - Real64 NucHiPollution; - Real64 NucLoPollution; - - // Default Constructor - ComponentProps() - : FuelFactorType(0), Source(0.0), CO2Pollution(0.0), COPollution(0.0), CH4Pollution(0.0), NOxPollution(0.0), N2OPollution(0.0), - SO2Pollution(0.0), PMPollution(0.0), PM10Pollution(0.0), PM25Pollution(0.0), NH3Pollution(0.0), NMVOCPollution(0.0), HgPollution(0.0), - PbPollution(0.0), WaterPollution(0.0), NucHiPollution(0.0), NucLoPollution(0.0) - { - } + constexpr std::array pollFuelFactors = { + 3.167, // Electricity + 1.084, // NaturalGas + 1.05, // FuelOil1 + 1.05, // FuelOil2 + 1.05, // Coal + 1.05, // Gasoline + 1.05, // Propane + 1.05, // Diesel + 1.0, // OtherFuel1 + 1.0 // OtherFuel2 + }; + + constexpr std::array fuel2pollFuel = { + PollFuel::Electricity, // Electricity + PollFuel::NaturalGas, // NaturalGas + PollFuel::Gasoline, // Gasoline + PollFuel::Diesel, // Diesel + PollFuel::Coal, // Coal + PollFuel::Propane, // Propane + PollFuel::FuelOil1, // FuelOilNo1 + PollFuel::FuelOil2, // FuelOilNo2 + PollFuel::OtherFuel1, // OtherFuel1 + PollFuel::OtherFuel2, // OtherFuel2 + PollFuel::Electricity, // DistrictCooling + PollFuel::NaturalGas, // DistrictHeating + PollFuel::NaturalGas, // Steam + }; - // Member Constructor - ComponentProps(int const FuelFactorType, - Real64 const Source, - Real64 const CO2Pollution, - Real64 const COPollution, - Real64 const CH4Pollution, - Real64 const NOxPollution, - Real64 const N2OPollution, - Real64 const SO2Pollution, - Real64 const PMPollution, - Real64 const PM10Pollution, - Real64 const PM25Pollution, - Real64 const NH3Pollution, - Real64 const NMVOCPollution, - Real64 const HgPollution, - Real64 const PbPollution, - Real64 const WaterPollution, - Real64 const NucHiPollution, - Real64 const NucLoPollution) - : FuelFactorType(FuelFactorType), Source(Source), CO2Pollution(CO2Pollution), COPollution(COPollution), CH4Pollution(CH4Pollution), - NOxPollution(NOxPollution), N2OPollution(N2OPollution), SO2Pollution(SO2Pollution), PMPollution(PMPollution), - PM10Pollution(PM10Pollution), PM25Pollution(PM25Pollution), NH3Pollution(NH3Pollution), NMVOCPollution(NMVOCPollution), - HgPollution(HgPollution), PbPollution(PbPollution), WaterPollution(WaterPollution), NucHiPollution(NucHiPollution), - NucLoPollution(NucLoPollution) - { - } + constexpr std::array pollFuel2fuel = { + Constant::eFuel::Electricity, // Electricity + Constant::eFuel::NaturalGas, // NaturalGas + Constant::eFuel::FuelOilNo1, // FuelOil1 + Constant::eFuel::FuelOilNo2, // FuelOil2 + Constant::eFuel::Coal, // Coal + Constant::eFuel::Gasoline, // Gasoline + Constant::eFuel::Propane, // Propane + Constant::eFuel::Diesel, // Diesel + Constant::eFuel::OtherFuel1, // OtherFuel1 + Constant::eFuel::OtherFuel2 // OtherFuel2 }; - struct CoefficientProps + enum class PollFuelComponent { - // Members - int FuelFactorType; - bool FuelFactorUsed; - Real64 Source; - Real64 CO2; - Real64 CO; - Real64 CH4; - Real64 NOx; - Real64 N2O; - Real64 SO2; - Real64 PM; - Real64 PM10; - Real64 PM25; - Real64 NH3; - Real64 NMVOC; - Real64 Hg; - Real64 Pb; - Real64 Water; - Real64 NucHi; - Real64 NucLo; - int SourceSched; - int CO2Sched; - int COSched; - int CH4Sched; - int NOxSched; - int N2OSched; - int SO2Sched; - int PMSched; - int PM10Sched; - int PM25Sched; - int NH3Sched; - int NMVOCSched; - int HgSched; - int PbSched; - int WaterSched; - int NucHiSched; - int NucLoSched; + Invalid = -1, + Electricity, + NaturalGas, + FuelOil1, + FuelOil2, + Coal, + Gasoline, + Propane, + Diesel, + OtherFuel1, + OtherFuel2, + ElectricitySurplusSold, + ElectricityPurchased, + Num + }; - // Default Constructor - CoefficientProps() - : FuelFactorType(0), FuelFactorUsed(false), Source(0.0), CO2(0.0), CO(0.0), CH4(0.0), NOx(0.0), N2O(0.0), SO2(0.0), PM(0.0), PM10(0.0), - PM25(0.0), NH3(0.0), NMVOC(0.0), Hg(0.0), Pb(0.0), Water(0.0), NucHi(0.0), NucLo(0.0), SourceSched(0), CO2Sched(0), COSched(0), - CH4Sched(0), NOxSched(0), N2OSched(0), SO2Sched(0), PMSched(0), PM10Sched(0), PM25Sched(0), NH3Sched(0), NMVOCSched(0), HgSched(0), - PbSched(0), WaterSched(0), NucHiSched(0), NucLoSched(0) - { - } + constexpr std::array pollFuelComp2pollFuel = { + PollFuel::Electricity, + PollFuel::NaturalGas, + PollFuel::FuelOil1, + PollFuel::FuelOil2, + PollFuel::Coal, + PollFuel::Gasoline, + PollFuel::Propane, + PollFuel::Diesel, + PollFuel::OtherFuel1, + PollFuel::OtherFuel2, + PollFuel::Electricity, + PollFuel::Electricity + }; - // Member Constructor - CoefficientProps(int const FuelFactorType, - bool const FuelFactorUsed, - Real64 const Source, - Real64 const CO2, - Real64 const CO, - Real64 const CH4, - Real64 const NOx, - Real64 const N2O, - Real64 const SO2, - Real64 const PM, - Real64 const PM10, - Real64 const PM25, - Real64 const NH3, - Real64 const NMVOC, - Real64 const Hg, - Real64 const Pb, - Real64 const Water, - Real64 const NucHi, - Real64 const NucLo, - int const SourceSched, - int const CO2Sched, - int const COSched, - int const CH4Sched, - int const NOxSched, - int const N2OSched, - int const SO2Sched, - int const PMSched, - int const PM10Sched, - int const PM25Sched, - int const NH3Sched, - int const NMVOCSched, - int const HgSched, - int const PbSched, - int const WaterSched, - int const NucHiSched, - int const NucLoSched) - : FuelFactorType(FuelFactorType), FuelFactorUsed(FuelFactorUsed), Source(Source), CO2(CO2), CO(CO), CH4(CH4), NOx(NOx), N2O(N2O), - SO2(SO2), PM(PM), PM10(PM10), PM25(PM25), NH3(NH3), NMVOC(NMVOC), Hg(Hg), Pb(Pb), Water(Water), NucHi(NucHi), NucLo(NucLo), - SourceSched(SourceSched), CO2Sched(CO2Sched), COSched(COSched), CH4Sched(CH4Sched), NOxSched(NOxSched), N2OSched(N2OSched), - SO2Sched(SO2Sched), PMSched(PMSched), PM10Sched(PM10Sched), PM25Sched(PM25Sched), NH3Sched(NH3Sched), NMVOCSched(NMVOCSched), - HgSched(HgSched), PbSched(PbSched), WaterSched(WaterSched), NucHiSched(NucHiSched), NucLoSched(NucLoSched) - { - } + constexpr std::array pollFuel2pollFuelComponent = { + PollFuelComponent::Electricity, + PollFuelComponent::NaturalGas, + PollFuelComponent::FuelOil1, + PollFuelComponent::FuelOil2, + PollFuelComponent::Coal, + PollFuelComponent::Gasoline, + PollFuelComponent::Propane, + PollFuelComponent::Diesel, + PollFuelComponent::OtherFuel1, + PollFuelComponent::OtherFuel2, + }; + + enum class PollFacilityMeter { + Invalid = -1, + Electricity, + NaturalGas, + FuelOil1, + FuelOil2, + Coal, + Gasoline, + Propane, + Diesel, + OtherFuel1, + OtherFuel2, + ElectricitySurplusSold, + ElectricityPurchased, + ElectricityProduced, + Steam, + HeatPurchased, + CoolPurchased, + Num + }; + + constexpr std::array pollFacilityMeterNames = { + "Electricity:Facility", + "NaturalGas:Facility", + "FuelOilNo1:Facility", + "FuelOilNo2:Facility", + "Coal:Facility", + "Gasoline:Facility", + "Propane:Facility", + "Diesel:Facility", + "OtherFuel1:Facility", + "OtherFuel2:Facility", + "ElectricitySurplusSold:Facility" + "ElectricityPurchased:Facility", + "ElectricityProduced:Facility", + "Steam:Facility", + "DistrictHeating:Facility", + "DistrictCooling:Facility" }; - struct PollutionProps + struct ComponentProps { - // Members - // Components - ComponentProps ElecComp; - ComponentProps ElecPurchComp; - ComponentProps ElecSurplusSoldComp; - ComponentProps NatGasComp; - ComponentProps FuelOil1Comp; - ComponentProps FuelOil2Comp; - ComponentProps CoalComp; - ComponentProps GasolineComp; - ComponentProps PropaneComp; - ComponentProps DieselComp; - ComponentProps OtherFuel1Comp; - ComponentProps OtherFuel2Comp; - // Total for all of the Pollutants - Real64 N2OPollutTotal; - Real64 CH4PollutTotal; - Real64 CO2PollutTotal; - // Total Carbon Equivalent Components - Real64 TotCarbonEquivFromN2O; - Real64 TotCarbonEquivFromCH4; - Real64 TotCarbonEquivFromCO2; - // Fuel Type Coefficients - CoefficientProps ElecCoef; - CoefficientProps NatGasCoef; - CoefficientProps FuelOil1Coef; - CoefficientProps FuelOil2Coef; - CoefficientProps CoalCoef; - CoefficientProps GasolineCoef; - CoefficientProps PropaneCoef; - CoefficientProps DieselCoef; - CoefficientProps OtherFuel1Coef; - CoefficientProps OtherFuel2Coef; - // Total Carbon Equivalent Coeffs - Real64 CarbonEquivN2O; - Real64 CarbonEquivCH4; - Real64 CarbonEquivCO2; - Real64 PurchHeatEffic; - Real64 PurchCoolCOP; - Real64 SteamConvEffic; - - // Default Constructor - PollutionProps() - : N2OPollutTotal(0.0), CH4PollutTotal(0.0), CO2PollutTotal(0.0), TotCarbonEquivFromN2O(0.0), TotCarbonEquivFromCH4(0.0), - TotCarbonEquivFromCO2(0.0), CarbonEquivN2O(0.0), CarbonEquivCH4(0.0), CarbonEquivCO2(0.0), PurchHeatEffic(0.0), PurchCoolCOP(0.0), - SteamConvEffic(0.0) - { - } - - // Member Constructor - PollutionProps(ComponentProps const &ElecComp, - ComponentProps const &ElecPurchComp, - ComponentProps const &ElecSurplusSoldComp, - ComponentProps const &NatGasComp, - ComponentProps const &FuelOil1Comp, - ComponentProps const &FuelOil2Comp, - ComponentProps const &CoalComp, - ComponentProps const &GasolineComp, - ComponentProps const &PropaneComp, - ComponentProps const &DieselComp, - ComponentProps const &OtherFuel1Comp, - ComponentProps const &OtherFuel2Comp, - Real64 const N2OPollutTotal, - Real64 const CH4PollutTotal, - Real64 const CO2PollutTotal, - Real64 const TotCarbonEquivFromN2O, - Real64 const TotCarbonEquivFromCH4, - Real64 const TotCarbonEquivFromCO2, - CoefficientProps const &ElecCoef, - CoefficientProps const &NatGasCoef, - CoefficientProps const &FuelOil1Coef, - CoefficientProps const &FuelOil2Coef, - CoefficientProps const &CoalCoef, - CoefficientProps const &GasolineCoef, - CoefficientProps const &PropaneCoef, - CoefficientProps const &DieselCoef, - CoefficientProps const &OtherFuel1Coef, - CoefficientProps const &OtherFuel2Coef, - Real64 const CarbonEquivN2O, - Real64 const CarbonEquivCH4, - Real64 const CarbonEquivCO2, - Real64 const PurchHeatEffic, - Real64 const PurchCoolCOP, - Real64 const SteamConvEffic) - : ElecComp(ElecComp), ElecPurchComp(ElecPurchComp), ElecSurplusSoldComp(ElecSurplusSoldComp), NatGasComp(NatGasComp), - FuelOil1Comp(FuelOil1Comp), FuelOil2Comp(FuelOil2Comp), CoalComp(CoalComp), GasolineComp(GasolineComp), PropaneComp(PropaneComp), - DieselComp(DieselComp), OtherFuel1Comp(OtherFuel1Comp), OtherFuel2Comp(OtherFuel2Comp), N2OPollutTotal(N2OPollutTotal), - CH4PollutTotal(CH4PollutTotal), CO2PollutTotal(CO2PollutTotal), TotCarbonEquivFromN2O(TotCarbonEquivFromN2O), - TotCarbonEquivFromCH4(TotCarbonEquivFromCH4), TotCarbonEquivFromCO2(TotCarbonEquivFromCO2), ElecCoef(ElecCoef), NatGasCoef(NatGasCoef), - FuelOil1Coef(FuelOil1Coef), FuelOil2Coef(FuelOil2Coef), CoalCoef(CoalCoef), GasolineCoef(GasolineCoef), PropaneCoef(PropaneCoef), - DieselCoef(DieselCoef), OtherFuel1Coef(OtherFuel1Coef), OtherFuel2Coef(OtherFuel2Coef), CarbonEquivN2O(CarbonEquivN2O), - CarbonEquivCH4(CarbonEquivCH4), CarbonEquivCO2(CarbonEquivCO2), PurchHeatEffic(PurchHeatEffic), PurchCoolCOP(PurchCoolCOP), - SteamConvEffic(SteamConvEffic) - { - } + Real64 sourceVal = 0.0; + std::array pollutantVals = {0.0}; }; - struct FuelTypeProps + struct CoefficientProps { - // Members - // FuelType Names - Array1D FuelTypeNames; - // Fuel Types used with the Pollution Factors - Real64 Elec; - Real64 NatGas; - Real64 FuelOil1; - Real64 FuelOil2; - Real64 Coal; - Real64 Gasoline; - Real64 Propane; - Real64 Diesel; - Real64 OtherFuel1; - Real64 OtherFuel2; - Real64 ElecPurch; - Real64 ElecSold; - // Facility Meter Indexes - int ElecFacilityIndex; - int DieselFacilityIndex; - int PurchCoolFacilityIndex; - int PurchHeatFacilityIndex; - int NatGasFacilityIndex; - int GasolineFacilityIndex; - int CoalFacilityIndex; - int FuelOil1FacilityIndex; - int FuelOil2FacilityIndex; - int PropaneFacilityIndex; - int OtherFuel1FacilityIndex; - int OtherFuel2FacilityIndex; - int ElecProducedFacilityIndex; - int SteamFacilityIndex; - int ElecPurchasedFacilityIndex; - int ElecSurplusSoldFacilityIndex; - // Facility Meter Values used in Pollution Calcs - Real64 ElecFacility; - Real64 DieselFacility; - Real64 PurchCoolFacility; - Real64 PurchHeatFacility; - Real64 NatGasFacility; - Real64 GasolineFacility; - Real64 CoalFacility; - Real64 FuelOil1Facility; - Real64 FuelOil2Facility; - Real64 PropaneFacility; - Real64 OtherFuel1Facility; - Real64 OtherFuel2Facility; - Real64 ElecProducedFacility; - Real64 SteamFacility; - Real64 ElecPurchasedFacility; - Real64 ElecSurplusSoldFacility; - - // Default Constructor - FuelTypeProps() - : FuelTypeNames({1, static_cast(PollFactor::Num)}, Constant::eFuel::Invalid), Elec(0.0), NatGas(0.0), FuelOil1(0.0), FuelOil2(0.0), - Coal(0.0), Gasoline(0.0), Propane(0.0), Diesel(0.0), OtherFuel1(0.0), OtherFuel2(0.0), ElecPurch(0.0), ElecSold(0.0), - ElecFacilityIndex(0), DieselFacilityIndex(0), PurchCoolFacilityIndex(0), PurchHeatFacilityIndex(0), NatGasFacilityIndex(0), - GasolineFacilityIndex(0), CoalFacilityIndex(0), FuelOil1FacilityIndex(0), FuelOil2FacilityIndex(0), PropaneFacilityIndex(0), - OtherFuel1FacilityIndex(0), OtherFuel2FacilityIndex(0), ElecProducedFacilityIndex(0), SteamFacilityIndex(0), - ElecPurchasedFacilityIndex(0), ElecSurplusSoldFacilityIndex(0), ElecFacility(0.0), DieselFacility(0.0), PurchCoolFacility(0.0), - PurchHeatFacility(0.0), NatGasFacility(0.0), GasolineFacility(0.0), CoalFacility(0.0), FuelOil1Facility(0.0), FuelOil2Facility(0.0), - PropaneFacility(0.0), OtherFuel1Facility(0.0), OtherFuel2Facility(0.0), ElecProducedFacility(0.0), SteamFacility(0.0), - ElecPurchasedFacility(0.0), ElecSurplusSoldFacility(0.0) - { - } + bool used = false; + Real64 sourceCoeff = 0.0; + std::array pollutantCoeffs = {0.0}; + int sourceSchedNum = 0; + std::array pollutantSchedNums = {0}; }; void CalculatePollution(EnergyPlusData &state); @@ -418,21 +295,12 @@ namespace PollutionModule { void CheckPollutionMeterReporting(EnergyPlusData &state); - void CheckFFSchedule(EnergyPlusData &state, - std::string const ¤tModuleObject, // the module Object - std::string const &resourceType, // resource type (Natural Gas, etc) - std::string const &fieldName, // Actual field name - std::string const &ScheduleName, // Schedule Name as input - int &SchedulePtr, // Schedule Index - bool &ErrorsFound // true if errors found - ); - void CalcPollution(EnergyPlusData &state); void ReadEnergyMeters(EnergyPlusData &state); void GetFuelFactorInfo(EnergyPlusData &state, - Constant::eFuel const &fuelName, // input fuel name (standard from Tabular reports) + Constant::eFuel fuel, // input fuel name (standard from Tabular reports) bool &fuelFactorUsed, // return value true if user has entered this fuel Real64 &fuelSourceFactor, // if used, the source factor bool &fuelFactorScheduleUsed, // if true, schedules for this fuel are used @@ -445,9 +313,9 @@ namespace PollutionModule { Real64 &sourceFactorSteam // if entered, the source factor for Steam ); -} // namespace PollutionModule +} // namespace Pollution -struct PollutionModuleData : BaseGlobalStruct +struct PollutionData : BaseGlobalStruct { bool PollutionReportSetup = false; @@ -455,533 +323,29 @@ struct PollutionModuleData : BaseGlobalStruct int NumEnvImpactFactors = 0; int NumFuelFactors = 0; - // Object Data - PollutionModule::PollutionProps Pollution = { - PollutionModule::ComponentProps( - static_cast(PollutionModule::PollFactor::Elec), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), - PollutionModule::ComponentProps( - static_cast(PollutionModule::PollFactor::Elec), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), - PollutionModule::ComponentProps( - static_cast(PollutionModule::PollFactor::Elec), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::NatGas), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::FuelOil1), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::FuelOil2), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps( - static_cast(PollutionModule::PollFactor::Coal), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Gasoline), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Propane), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Diesel), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::OtherFuel1), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::OtherFuel2), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Elec), - false, - 3.167, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::NatGas), - false, - 1.084, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::FuelOil1), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::FuelOil2), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Coal), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Gasoline), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Propane), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Diesel), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::OtherFuel1), - false, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::OtherFuel2), - false, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0}; - PollutionModule::FuelTypeProps FuelType; + std::array pollComps; + + // Meters, meter values, and grouped meter values + std::array facilityMeterNums; + std::array facilityMeterVals; + std::array facilityMeterFuelComponentVals = {0.0}; + + std::array pollutantVals; + + // Total Carbon Equivalent Components + Real64 TotCarbonEquivFromN2O; + Real64 TotCarbonEquivFromCH4; + Real64 TotCarbonEquivFromCO2; + // Fuel Type Coefficients + std::array pollCoeffs; + // Total Carbon Equivalent Coeffs + Real64 CarbonEquivN2O = 0.0; + Real64 CarbonEquivCH4 = 0.0; + Real64 CarbonEquivCO2 = 0.0; + Real64 PurchHeatEffic = 0.0; + Real64 PurchCoolCOP = 0.0; + Real64 SteamConvEffic = 0.0; + void clear_state() override { @@ -989,595 +353,6 @@ struct PollutionModuleData : BaseGlobalStruct this->GetInputFlagPollution = true; this->NumEnvImpactFactors = 0; this->NumFuelFactors = 0; - this->Pollution = {PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Elec), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Elec), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Elec), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::NatGas), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::FuelOil1), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::FuelOil2), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Coal), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Gasoline), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Propane), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::Diesel), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::OtherFuel1), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - PollutionModule::ComponentProps(static_cast(PollutionModule::PollFactor::OtherFuel2), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Elec), - false, - 3.167, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::NatGas), - false, - 1.084, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::FuelOil1), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::FuelOil2), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Coal), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Gasoline), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Propane), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::Diesel), - false, - 1.05, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::OtherFuel1), - false, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - PollutionModule::CoefficientProps(static_cast(PollutionModule::PollFactor::OtherFuel2), - false, - 1.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0), - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0}; - this->FuelType = {}; } }; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 4d51da78544..bdda4b4f4b8 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -290,15 +290,15 @@ namespace SimulationManager { NodeInputManager::SetupNodeVarsForReporting(state); state.dataGlobal->MetersHaveBeenInitialized = true; - PollutionModule::SetupPollutionMeterReporting(state); + Pollution::SetupPollutionMeterReporting(state); SystemReports::AllocateAndSetUpVentReports(state); if (state.dataPluginManager->pluginManager) { EnergyPlus::PluginManagement::PluginManager::setupOutputVariables(state); } UpdateMeterReporting(state); - PollutionModule::CheckPollutionMeterReporting(state); + Pollution::CheckPollutionMeterReporting(state); state.dataElectPwrSvcMgr->facilityElectricServiceObj->verifyCustomMetersElecPowerMgr(state); - PollutionModule::SetupPollutionCalculations(state); + Pollution::SetupPollutionCalculations(state); DemandManager::InitDemandManagers(state); BranchInputManager::TestBranchIntegrity(state, ErrFound); if (ErrFound) TerminalError = true; diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 2b41275e263..58e1a496193 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -8495,7 +8495,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_ConfirmConversionFactors) bool fFScheduleUsed; int ffScheduleIndex; - PollutionModule::GetFuelFactorInfo(*state, Constant::eFuel::Steam, fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); + Pollution::GetFuelFactorInfo(*state, Constant::eFuel::Steam, fuelFactorUsed, curSourceFactor, fFScheduleUsed, ffScheduleIndex); EXPECT_EQ(curSourceFactor, 1.2); } diff --git a/tst/EnergyPlus/unit/PollutionModule.unit.cc b/tst/EnergyPlus/unit/PollutionModule.unit.cc index 52816b39140..ab3ab37381b 100644 --- a/tst/EnergyPlus/unit/PollutionModule.unit.cc +++ b/tst/EnergyPlus/unit/PollutionModule.unit.cc @@ -55,7 +55,7 @@ #include using namespace EnergyPlus; -using namespace EnergyPlus::PollutionModule; +using namespace EnergyPlus::Pollution; TEST_F(EnergyPlusFixture, PollutionModule_TestOutputVariables) { @@ -468,63 +468,62 @@ TEST_F(EnergyPlusFixture, PollutionModule_TestOutputVariables) }); ASSERT_TRUE(process_idf(idf_objects)); - state->dataPollutionModule->FuelType.FuelTypeNames.allocate(10); - state->dataPollutionModule->FuelType.FuelTypeNames = Constant::eFuel::Invalid; - state->dataPollutionModule->GetInputFlagPollution = true; - PollutionModule::SetupPollutionMeterReporting(*state); + state->dataPollution->GetInputFlagPollution = true; + Pollution::SetupPollutionMeterReporting(*state); // Test get output variables for Total Sky Cover and Opaque Sky Cover - std::string fuelTypeNames[9] = {"NaturalGas", "Diesel", "Gasoline", "Propane", "FuelOilNo1", "FuelOilNo2", "OtherFuel1", "Coal", "Electricity"}; - for (unsigned long i = 0; i < size(fuelTypeNames); i++) { - EXPECT_EQ(format("Site:Environmental Impact {} Source Energy", fuelTypeNames[i]), + for (int i = 0; i < (int)PollFuel::Num; i++) { + std::string_view fuelName = Constant::eFuelNames[(int)pollFuel2fuel[i]]; + + EXPECT_EQ(format("Site:Environmental Impact {} Source Energy", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 1).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} CO2 Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} CO2 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 2).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} CO Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} CO Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 3).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} CH4 Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} CH4 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 4).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} NOx Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} NOx Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 5).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} N2O Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} N2O Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 6).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} SO2 Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} SO2 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 7).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} PM Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} PM Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 8).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} PM10 Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} PM10 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 9).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} PM2.5 Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} PM2.5 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 10).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} NH3 Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} NH3 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 11).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} NMVOC Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} NMVOC Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 12).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} Hg Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} Hg Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 13).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} Pb Emissions Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} Pb Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 14).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} Water Consumption Volume", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} Water Consumption Volume", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 15).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} Nuclear High Level Waste Mass", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} Nuclear High Level Waste Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 16).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} Nuclear Low Level Waste Volume", fuelTypeNames[i]), + EXPECT_EQ(format("Site:Environmental Impact {} Nuclear Low Level Waste Volume", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 17).VarName); } // Variables specific to the Electricity fuel type EXPECT_EQ("Site:Environmental Impact Purchased Electricity Source Energy", - state->dataOutputProcessor->RVariableTypes(size(fuelTypeNames) * 17 + 1).VarName); + state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 1).VarName); EXPECT_EQ("Site:Environmental Impact Surplus Sold Electricity Source", - state->dataOutputProcessor->RVariableTypes(size(fuelTypeNames) * 17 + 2).VarName); + state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 2).VarName); // Variables always setup for total carbon equivalent EXPECT_EQ("Site:Environmental Impact Total N2O Emissions Carbon Equivalent Mass", - state->dataOutputProcessor->RVariableTypes(size(fuelTypeNames) * 17 + 3).VarName); + state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 3).VarName); EXPECT_EQ("Site:Environmental Impact Total CH4 Emissions Carbon Equivalent Mass", - state->dataOutputProcessor->RVariableTypes(size(fuelTypeNames) * 17 + 4).VarName); + state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 4).VarName); EXPECT_EQ("Site:Environmental Impact Total CO2 Emissions Carbon Equivalent Mass", - state->dataOutputProcessor->RVariableTypes(size(fuelTypeNames) * 17 + 5).VarName); + state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 5).VarName); } TEST_F(EnergyPlusFixture, PollutionModule_TestEnvironmentalImpactFactors) @@ -580,9 +579,9 @@ TEST_F(EnergyPlusFixture, PollutionModule_TestEnvironmentalImpactFactors) Real64 ExpectedOutput(0.3); Real64 AllowedTolerance(0.001); - PollutionModule::GetPollutionFactorInput(*state); + Pollution::GetPollutionFactorInput(*state); // The get routine should rest the steam conversion efficiency to the default value of 0.25. // Previously because of a typo, it would reset it to the input value of zero (or even a negative number). - ASSERT_NEAR(state->dataPollutionModule->Pollution.SteamConvEffic, ExpectedOutput, AllowedTolerance); + ASSERT_NEAR(state->dataPollution->SteamConvEffic, ExpectedOutput, AllowedTolerance); } From d8a961dcd2bc65281bdab8ef8ed6b2e27dd6eb43 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Mon, 18 Sep 2023 13:06:18 -0500 Subject: [PATCH 02/50] Add end use enum definitions. --- src/EnergyPlus/OutputProcessor.hh | 47 ++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index ba32aed671c..1285d8ff343 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -136,20 +136,39 @@ namespace OutputProcessor { constexpr int N_WriteTimeStampFormatData(100); - static constexpr std::array endUseCategoryNames = {"HEATING", - "COOLING", - "INTERIORLIGHTS", - "EXTERIORLIGHTS", - "INTERIOREQUIPMENT", - "EXTERIOREQUIPMENT", - "FANS", - "PUMPS", - "HEATREJECTION", - "HUMIDIFIER", - "HEATRECOVERY", - "WATERSYSTEMS", - "REFRIGERATION", - "COGENERATION"}; + enum class SOVendUseCategoryType + { + Invalid = -1, + Heating, + Cooling, + Interiorlights, + Exteriorlights, + Interiorequipment, + Exteriorequipment, + Fans, + Pumps, + Heatrejection, + Humidifier, + Heatrecovery, + Watersystems, + Refrigeration, + Cogeneration, + Num + }; + static constexpr std::array endUseCategoryNames = {"HEATING", + "COOLING", + "INTERIORLIGHTS", + "EXTERIORLIGHTS", + "INTERIOREQUIPMENT", + "EXTERIOREQUIPMENT", + "FANS", + "PUMPS", + "HEATREJECTION", + "HUMIDIFIER", + "HEATRECOVERY", + "WATERSYSTEMS", + "REFRIGERATION", + "COGENERATION"}; constexpr int RVarAllocInc(1000); constexpr int LVarAllocInc(1000); From 6da14d93a65e03180fdb1256d7d00b2ab95e76dc Mon Sep 17 00:00:00 2001 From: jcyuan Date: Mon, 18 Sep 2023 14:01:30 -0500 Subject: [PATCH 03/50] SOV wrapper required header changes. --- src/EnergyPlus/OutputProcessor.hh | 69 ++++++++++++++++--------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 1285d8ff343..8828186a242 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -136,39 +136,20 @@ namespace OutputProcessor { constexpr int N_WriteTimeStampFormatData(100); - enum class SOVendUseCategoryType - { - Invalid = -1, - Heating, - Cooling, - Interiorlights, - Exteriorlights, - Interiorequipment, - Exteriorequipment, - Fans, - Pumps, - Heatrejection, - Humidifier, - Heatrecovery, - Watersystems, - Refrigeration, - Cogeneration, - Num - }; - static constexpr std::array endUseCategoryNames = {"HEATING", - "COOLING", - "INTERIORLIGHTS", - "EXTERIORLIGHTS", - "INTERIOREQUIPMENT", - "EXTERIOREQUIPMENT", - "FANS", - "PUMPS", - "HEATREJECTION", - "HUMIDIFIER", - "HEATRECOVERY", - "WATERSYSTEMS", - "REFRIGERATION", - "COGENERATION"}; + static constexpr std::array endUseCategoryNames = {"HEATING", + "COOLING", + "INTERIORLIGHTS", + "EXTERIORLIGHTS", + "INTERIOREQUIPMENT", + "EXTERIOREQUIPMENT", + "FANS", + "PUMPS", + "HEATREJECTION", + "HUMIDIFIER", + "HEATRECOVERY", + "WATERSYSTEMS", + "REFRIGERATION", + "COGENERATION"}; constexpr int RVarAllocInc(1000); constexpr int LVarAllocInc(1000); @@ -257,6 +238,8 @@ namespace OutputProcessor { Yearly, // Write out at 'EndYearFlag' Num }; + static constexpr std::array ReportingFrequencyNames = { + "TIMESTEP", "HOURLY", "DAILY", "MONTHLY", "SIMULATION", "YEARLY"}; enum class StoreType { @@ -862,6 +845,26 @@ namespace OutputProcessor { // within the OutputProcessor. // ***************************************************************************** +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable (with units) + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + Real64 &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue, // Associated Key for this variable + OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency + Constant::eResource ResourceTypeKey, // Meter Resource Type (Electricity, Gas, etc) + Constant::EndUse EndUseKey, // Meter End Use Key (Lights, Heating, Cooling, etc) + std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) + std::string_view const GroupKey = {}, // Meter Super Group Key (Building, System, Plant) + std::string_view const ZoneKey = {}, // Meter Zone Key (zone name) + int const ZoneMult = 1, // Zone Multiplier, defaults to 1 + int const ZoneListMult = 1, // Zone List Multiplier, defaults to 1 + int const indexGroupKey = -999, // Group identifier for SQL output + std::string_view const customUnitName = {}, // the custom name for the units from EMS definition of units + std::string_view const SpaceType = {} // Space type (applicable for Building group only) +); + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable (with units) OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable From e2e0b58c62fae63818f457dbbb4c24fa1ebf700e Mon Sep 17 00:00:00 2001 From: jcyuan Date: Mon, 18 Sep 2023 14:02:12 -0500 Subject: [PATCH 04/50] SOV wrapper initial implementation. --- src/EnergyPlus/OutputProcessor.cc | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 1c5fb2b04ea..d2a78458a72 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4338,6 +4338,57 @@ namespace OutputProcessor { } // namespace OutputProcessor +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable (with units) + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + Real64 &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue, // Associated Key for this variable + OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency + Constant::eResource ResourceTypeKey, // Meter Resource Type (Electricity, Gas, etc) + Constant::EndUse EndUseKey, // Meter End Use Key (Lights, Heating, Cooling, etc) + std::string_view const EndUseSubKey, // Meter End Use Sub Key (General Lights, Task Lights, etc) + std::string_view const GroupKey, // Meter Super Group Key (Building, System, Plant) + std::string_view const ZoneKey, // Meter Zone Key (zone name) + int const ZoneMult, // Zone Multiplier, defaults to 1 + int const ZoneListMult, // Zone List Multiplier, defaults to 1 + int const indexGroupKey, // Group identifier for SQL output + std::string_view const customUnitName, // the custom name for the units from EMS definition of units + std::string_view const SpaceType // Space type (applicable for Building group only) +) +{ + if (EndUseKey == Constant::EndUse::Invalid) { + // Severe warning message + ShowSevereError(state, "Invalid End Use Category Type."); + } else if (ReportFreq == OutputProcessor::ReportingFrequency::EachCall) // maybe EachCall is valid + { + // Need to further consider if "EachCall" option is valid + ShowSevereError(state, "Invalid Reporting Frequency Type."); + } else if (ResourceTypeKey == Constant::eResource::Invalid) { + ShowSevereError(state, "Invalid Resource Type."); + } else { + SetupOutputVariable(state, + VariableName, + VariableUnit, + ActualVariable, + TimeStepTypeKey, + VariableTypeKey, + KeyedValue, + OutputProcessor::ReportingFrequencyNames[static_cast(ReportFreq)], + Constant::eResourceNames[static_cast(ResourceTypeKey)], // or eResourceNamesUC + OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)], + EndUseSubKey, + GroupKey, + ZoneKey, + ZoneMult, + ZoneListMult, + indexGroupKey, + customUnitName, + SpaceType); + } +} + // TODO: Probably move these to a different location void SetupOutputVariable(EnergyPlusData &state, From 654c174075163fab16975ae3980d241a64a924f3 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 26 Sep 2023 11:56:06 -0500 Subject: [PATCH 05/50] Mech vent people list for CO2 control --- src/EnergyPlus/MixedAir.cc | 41 ++++++++++++++++++++++++-------------- src/EnergyPlus/MixedAir.hh | 1 + 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index f4763c74b34..49a5ddee4a4 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -2761,6 +2761,18 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con } } + // Fill People index lists if needed + if (vent_mech.SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc) { + for (int peopleNum = 1; peopleNum <= state.dataHeatBal->TotPeople; ++peopleNum) { + for (auto &thisMechVentZone : vent_mech.VentMechZone) { + if (state.dataHeatBal->People(peopleNum).ZonePtr == thisMechVentZone.zoneNum) { + thisMechVentZone.peopleIndexes.push_back(peopleNum); + break; + } + } + } + } + // Check to see if any zones on an air loop are not accounted for by a mechanical ventilation object for (int AirLoopZoneInfoZoneNum = 1; AirLoopZoneInfoZoneNum <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++AirLoopZoneInfoZoneNum) { @@ -3608,19 +3620,18 @@ Real64 VentilationMechanicalProps::CalcMechVentController(EnergyPlusData &state, // new local variables for DCV // Zone OA flow rate based on each calculation method [m3/s] std::array(DataSizing::OAFlowCalcMethod::Num)> ZoneOACalc{0.0}; - Real64 CO2PeopleGeneration = 0; // CO2 generation from people at design level - Real64 ZoneOABZ; // Zone breathing-zone OA flow rate [m3/s] - Real64 ZoneOA; // Zone OA flow rate [m3/s] - Real64 ZoneOAFrac; // Zone OA fraction (as a fraction of actual supply air flow rate) - Real64 SysOAuc; // System uncorrected OA flow rate - Real64 SysOA; // System supply OA volume flow rate [m3/s] - Real64 SysEv; // System ventilation efficiency - Real64 NodeTemp; // node temperature - Real64 NodeHumRat; // node humidity ratio - Real64 ZoneMaxCO2 = 0.0; // Breathing-zone CO2 concentartion - Real64 ZoneMinCO2 = 0.0; // Minimum CO2 concentration in zone - Real64 ZoneOAMin = 0.0; // Minimum Zone OA flow rate when the zone is unoccupied (i.e. ZoneOAPeople = 0) - Real64 ZoneOAMax = 0.0; // Maximum Zone OA flow rate (ZoneOAPeople + ZoneOACalc[static_cast(DataSizing::OAFlowCalcMethod::PerArea)]) + Real64 ZoneOABZ; // Zone breathing-zone OA flow rate [m3/s] + Real64 ZoneOA; // Zone OA flow rate [m3/s] + Real64 ZoneOAFrac; // Zone OA fraction (as a fraction of actual supply air flow rate) + Real64 SysOAuc; // System uncorrected OA flow rate + Real64 SysOA; // System supply OA volume flow rate [m3/s] + Real64 SysEv; // System ventilation efficiency + Real64 NodeTemp; // node temperature + Real64 NodeHumRat; // node humidity ratio + Real64 ZoneMaxCO2 = 0.0; // Breathing-zone CO2 concentartion + Real64 ZoneMinCO2 = 0.0; // Minimum CO2 concentration in zone + Real64 ZoneOAMin = 0.0; // Minimum Zone OA flow rate when the zone is unoccupied (i.e. ZoneOAPeople = 0) + Real64 ZoneOAMax = 0.0; // Maximum Zone OA flow rate (ZoneOAPeople + ZoneOACalc[static_cast(DataSizing::OAFlowCalcMethod::PerArea)]) Real64 MechVentOAMassFlow = 0.0; // Apply mechanical ventilation only when it is available/allowed @@ -3882,8 +3893,8 @@ Real64 VentilationMechanicalProps::CalcMechVentController(EnergyPlusData &state, // Calculate zone maximum target CO2 concentration in PPM if (this->SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc) { // Accumulate CO2 generation from people at design occupancy and current activity level - for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) { - if (state.dataHeatBal->People(PeopleNum).ZonePtr != ZoneNum) continue; + Real64 CO2PeopleGeneration = 0.0; + for (int const PeopleNum : thisMechVentZone.peopleIndexes) { CO2PeopleGeneration += state.dataHeatBal->People(PeopleNum).NumberOfPeople * state.dataHeatBal->People(PeopleNum).CO2RateFactor * diff --git a/src/EnergyPlus/MixedAir.hh b/src/EnergyPlus/MixedAir.hh index 9596783a5d7..71f94f93938 100644 --- a/src/EnergyPlus/MixedAir.hh +++ b/src/EnergyPlus/MixedAir.hh @@ -284,6 +284,7 @@ namespace MixedAir { DataSizing::OAFlowCalcMethod ZoneOAFlowMethod = DataSizing::OAFlowCalcMethod::PerPerson; // OA flow method for each zone int ZoneOASchPtr = 0; // Index to the outdoor air schedule for each zone (from DesignSpecification:OutdoorAir or default) Real64 OAPropCtlMinRateSchPtr = 0; // Outdoor design OA flow rate schedule from DesignSpecification:OutdoorAir + EPVector peopleIndexes; // List of People objects in this zone (for SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc) }; struct VentilationMechanicalProps // Derived type for Ventilation:Mechanical data From 8886f8c397b2710df877604907079a2307b8f4e1 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 28 Sep 2023 17:06:54 -0500 Subject: [PATCH 06/50] Deal with the scenario of using Detailed reporting frequency, which is a valid option. --- src/EnergyPlus/OutputProcessor.cc | 62 ++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index c29935b768f..6ddb276aa4e 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4301,31 +4301,49 @@ void SetupOutputVariable(EnergyPlusData &state, if (EndUseKey == Constant::EndUse::Invalid) { // Severe warning message ShowSevereError(state, "Invalid End Use Category Type."); - } else if (ReportFreq == OutputProcessor::ReportingFrequency::EachCall) // maybe EachCall is valid - { - // Need to further consider if "EachCall" option is valid - ShowSevereError(state, "Invalid Reporting Frequency Type."); } else if (ResourceTypeKey == Constant::eResource::Invalid) { ShowSevereError(state, "Invalid Resource Type."); } else { - SetupOutputVariable(state, - VariableName, - VariableUnit, - ActualVariable, - TimeStepTypeKey, - VariableTypeKey, - KeyedValue, - OutputProcessor::ReportingFrequencyNames[static_cast(ReportFreq)], - Constant::eResourceNames[static_cast(ResourceTypeKey)], // or eResourceNamesUC - OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)], - EndUseSubKey, - GroupKey, - ZoneKey, - ZoneMult, - ZoneListMult, - indexGroupKey, - customUnitName, - SpaceType); + if (ReportFreq == OutputProcessor::ReportingFrequency::EachCall) // This is valid + { + SetupOutputVariable(state, + VariableName, + VariableUnit, + ActualVariable, + TimeStepTypeKey, + VariableTypeKey, + KeyedValue, + "DETAILED", + Constant::eResourceNames[static_cast(ResourceTypeKey)], // or eResourceNamesUC + OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)], + EndUseSubKey, + GroupKey, + ZoneKey, + ZoneMult, + ZoneListMult, + indexGroupKey, + customUnitName, + SpaceType); + } else { + SetupOutputVariable(state, + VariableName, + VariableUnit, + ActualVariable, + TimeStepTypeKey, + VariableTypeKey, + KeyedValue, + OutputProcessor::ReportingFrequencyNames[static_cast(ReportFreq)], + Constant::eResourceNames[static_cast(ResourceTypeKey)], // or eResourceNamesUC + OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)], + EndUseSubKey, + GroupKey, + ZoneKey, + ZoneMult, + ZoneListMult, + indexGroupKey, + customUnitName, + SpaceType); + } } } From 2bfe771b67e1266674f75d7e716377b3e2062866 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 08:52:17 -0500 Subject: [PATCH 07/50] Transitions for a common set of calls. --- src/EnergyPlus/OutputProcessor.cc | 50 +++++++++++++++++++++++++++++++ src/EnergyPlus/OutputProcessor.hh | 24 ++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 6ddb276aa4e..ae30cc6ce1a 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4591,6 +4591,56 @@ void SetupOutputVariable(EnergyPlusData &state, } } +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable + OutputProcessor::Unit const VariableUnit, // Actual units corresponding to the actual variable + int &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType const TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType const VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue // Associated Key for this variable +) +{ + std::string_view ReportFreq = ""; + SetupOutputVariable(state, + VariableName, // String Name of variable + VariableUnit, // Actual units corresponding to the actual variable + ActualVariable, // Actual Variable, used to set up pointer + TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + VariableTypeKey, // State, Average=1, NonState, Sum=2 + KeyedValue, // Associated Key for this variable + ReportFreq // Internal use -- causes reporting at this freqency + // indexGroupKey // Group identifier for SQL output + ); +} + +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable + OutputProcessor::Unit const VariableUnit, // Actual units corresponding to the actual variable + int &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType const TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType const VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue, // Associated Key for this variable + OutputProcessor::ReportingFrequency const ReportFreq, // Internal use -- causes reporting at this freqency + int const indexGroupKey // Group identifier for SQL output +) +{ + if (ReportFreq == OutputProcessor::ReportingFrequency::EachCall) // This is valid + { + SetupOutputVariable( + state, VariableName, VariableUnit, ActualVariable, TimeStepTypeKey, VariableTypeKey, KeyedValue, "DETAILED", indexGroupKey); + } else { + SetupOutputVariable(state, + VariableName, + VariableUnit, + ActualVariable, + TimeStepTypeKey, + VariableTypeKey, + KeyedValue, + OutputProcessor::ReportingFrequencyNames[static_cast(ReportFreq)], + indexGroupKey); + } +} + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable OutputProcessor::Unit const VariableUnit, // Actual units corresponding to the actual variable diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 9cd6933ec2e..6226dd3dd05 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -883,6 +883,17 @@ void SetupOutputVariable(EnergyPlusData &state, std::string_view const SpaceType = {} // Space type (applicable for Building group only) ); +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + int &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue // Associated Key for this variable + // std::string_view const ReportFreq = {}, // Internal use -- causes reporting at this freqency + // int const indexGroupKey = -999 // Group identifier for SQL output +); + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable @@ -890,7 +901,18 @@ void SetupOutputVariable(EnergyPlusData &state, OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string_view const KeyedValue, // Associated Key for this variable - std::string_view const ReportFreq = {}, // Internal use -- causes reporting at this freqency + OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency + int const indexGroupKey = -999 // Group identifier for SQL output +); + +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + int &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue, // Associated Key for this variable + std::string_view const ReportFreq, // Internal use -- causes reporting at this freqency int const indexGroupKey = -999 // Group identifier for SQL output ); From 050c112fcf0a2efbe2209c4cdb0b15005e2f43f8 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 08:58:58 -0500 Subject: [PATCH 08/50] Remove a couple of redudant comment lines. --- src/EnergyPlus/OutputProcessor.hh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 6226dd3dd05..ba5286a8c76 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -890,8 +890,6 @@ void SetupOutputVariable(EnergyPlusData &state, OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string_view const KeyedValue // Associated Key for this variable - // std::string_view const ReportFreq = {}, // Internal use -- causes reporting at this freqency - // int const indexGroupKey = -999 // Group identifier for SQL output ); void SetupOutputVariable(EnergyPlusData &state, From cf4e74c179da784c21d1564ff420f42db08f4912 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 09:11:56 -0500 Subject: [PATCH 09/50] Continue to engineer a transition for another set of calls. --- src/EnergyPlus/OutputProcessor.cc | 12 ++++++++++++ src/EnergyPlus/OutputProcessor.hh | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index ae30cc6ce1a..e2147d3ed69 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4278,6 +4278,18 @@ namespace OutputProcessor { } // namespace OutputProcessor +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable (with units) + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + Real64 &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue // Associated Key for this variable +) +{ + SetupOutputVariable(state, VariableName, VariableUnit, ActualVariable, TimeStepTypeKey, VariableTypeKey, KeyedValue, {}); +} + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable (with units) OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index ba5286a8c76..440f5cb3801 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -843,6 +843,15 @@ namespace OutputProcessor { // within the OutputProcessor. // ***************************************************************************** +void SetupOutputVariable(EnergyPlusData &state, + std::string_view const VariableName, // String Name of variable (with units) + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + Real64 &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue // Associated Key for this variable +); + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable (with units) OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable @@ -870,7 +879,7 @@ void SetupOutputVariable(EnergyPlusData &state, OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string_view const KeyedValue, // Associated Key for this variable - std::string_view const ReportFreq = {}, // Internal use -- causes reporting at this freqency + std::string_view const ReportFreq, // Internal use -- causes reporting at this freqency std::string_view const ResourceTypeKey = {}, // Meter Resource Type (Electricity, Gas, etc) std::string_view const EndUseKey = {}, // Meter End Use Key (Lights, Heating, Cooling, etc) std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) From eafe2ebbb826a7ea4c1016357a94bba435260871 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 11:31:33 -0500 Subject: [PATCH 10/50] Revisions on new enum call forms. --- src/EnergyPlus/OutputProcessor.cc | 18 ++++++++++++---- src/EnergyPlus/OutputProcessor.hh | 34 +++++++++++++++---------------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index e2147d3ed69..fa7d1ed75eb 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4310,12 +4310,22 @@ void SetupOutputVariable(EnergyPlusData &state, std::string_view const SpaceType // Space type (applicable for Building group only) ) { + std::string locResourceTypeKey = ""; + std::string locEndUseKey = ""; + if (EndUseKey == Constant::EndUse::Invalid) { // Severe warning message ShowSevereError(state, "Invalid End Use Category Type."); } else if (ResourceTypeKey == Constant::eResource::Invalid) { ShowSevereError(state, "Invalid Resource Type."); + } else if (ResourceTypeKey == Constant::eResource::Num) { + locResourceTypeKey = ""; + } else if (EndUseKey == Constant::EndUse::Num) { + locEndUseKey = ""; } else { + locResourceTypeKey = Constant::eResourceNames[static_cast(ResourceTypeKey)]; // or eResourceNamesUC + locEndUseKey = OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)]; + if (ReportFreq == OutputProcessor::ReportingFrequency::EachCall) // This is valid { SetupOutputVariable(state, @@ -4326,8 +4336,8 @@ void SetupOutputVariable(EnergyPlusData &state, VariableTypeKey, KeyedValue, "DETAILED", - Constant::eResourceNames[static_cast(ResourceTypeKey)], // or eResourceNamesUC - OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)], + locResourceTypeKey, + locEndUseKey, EndUseSubKey, GroupKey, ZoneKey, @@ -4345,8 +4355,8 @@ void SetupOutputVariable(EnergyPlusData &state, VariableTypeKey, KeyedValue, OutputProcessor::ReportingFrequencyNames[static_cast(ReportFreq)], - Constant::eResourceNames[static_cast(ResourceTypeKey)], // or eResourceNamesUC - OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)], + locResourceTypeKey, + locEndUseKey, EndUseSubKey, GroupKey, ZoneKey, diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 440f5cb3801..a609ece4adf 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -853,23 +853,23 @@ void SetupOutputVariable(EnergyPlusData &state, ); void SetupOutputVariable(EnergyPlusData &state, - std::string_view const VariableName, // String Name of variable (with units) - OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable - Real64 &ActualVariable, // Actual Variable, used to set up pointer - OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 - OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 - std::string_view const KeyedValue, // Associated Key for this variable - OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency - Constant::eResource ResourceTypeKey, // Meter Resource Type (Electricity, Gas, etc) - Constant::EndUse EndUseKey, // Meter End Use Key (Lights, Heating, Cooling, etc) - std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) - std::string_view const GroupKey = {}, // Meter Super Group Key (Building, System, Plant) - std::string_view const ZoneKey = {}, // Meter Zone Key (zone name) - int const ZoneMult = 1, // Zone Multiplier, defaults to 1 - int const ZoneListMult = 1, // Zone List Multiplier, defaults to 1 - int const indexGroupKey = -999, // Group identifier for SQL output - std::string_view const customUnitName = {}, // the custom name for the units from EMS definition of units - std::string_view const SpaceType = {} // Space type (applicable for Building group only) + std::string_view const VariableName, // String Name of variable (with units) + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + Real64 &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue, // Associated Key for this variable + OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency + Constant::eResource ResourceTypeKey = Constant::eResource::Num, // Meter Resource Type (Electricity, Gas, etc) + Constant::EndUse EndUseKey = Constant::EndUse::Num, // Meter End Use Key (Lights, Heating, Cooling, etc) + std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) + std::string_view const GroupKey = {}, // Meter Super Group Key (Building, System, Plant) + std::string_view const ZoneKey = {}, // Meter Zone Key (zone name) + int const ZoneMult = 1, // Zone Multiplier, defaults to 1 + int const ZoneListMult = 1, // Zone List Multiplier, defaults to 1 + int const indexGroupKey = -999, // Group identifier for SQL output + std::string_view const customUnitName = {}, // the custom name for the units from EMS definition of units + std::string_view const SpaceType = {} // Space type (applicable for Building group only) ); void SetupOutputVariable(EnergyPlusData &state, From a990780265b357ff5e3bb430ce5f7e36392fd193 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 11:34:35 -0500 Subject: [PATCH 11/50] Adjust orders within the new enum call wrapper. --- src/EnergyPlus/OutputProcessor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index fa7d1ed75eb..c9da801e455 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4313,13 +4313,13 @@ void SetupOutputVariable(EnergyPlusData &state, std::string locResourceTypeKey = ""; std::string locEndUseKey = ""; - if (EndUseKey == Constant::EndUse::Invalid) { - // Severe warning message - ShowSevereError(state, "Invalid End Use Category Type."); - } else if (ResourceTypeKey == Constant::eResource::Invalid) { + if (ResourceTypeKey == Constant::eResource::Invalid) { ShowSevereError(state, "Invalid Resource Type."); } else if (ResourceTypeKey == Constant::eResource::Num) { locResourceTypeKey = ""; + } else if (EndUseKey == Constant::EndUse::Invalid) { + // Severe warning message + ShowSevereError(state, "Invalid End Use Category Type."); } else if (EndUseKey == Constant::EndUse::Num) { locEndUseKey = ""; } else { From e66d847cbae6780e36b3b4fd0262deee8c1f4712 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 11:36:42 -0500 Subject: [PATCH 12/50] Augument warning messages level to fatal. --- src/EnergyPlus/OutputProcessor.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index c9da801e455..a57ee8e3e96 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4314,12 +4314,13 @@ void SetupOutputVariable(EnergyPlusData &state, std::string locEndUseKey = ""; if (ResourceTypeKey == Constant::eResource::Invalid) { - ShowSevereError(state, "Invalid Resource Type."); + // Fatal error warning message + ShowFatalError(state, "Invalid Resource Type."); } else if (ResourceTypeKey == Constant::eResource::Num) { locResourceTypeKey = ""; } else if (EndUseKey == Constant::EndUse::Invalid) { - // Severe warning message - ShowSevereError(state, "Invalid End Use Category Type."); + // Fatal error warning message + ShowFatalError(state, "Invalid End Use Category Type."); } else if (EndUseKey == Constant::EndUse::Num) { locEndUseKey = ""; } else { From 7f8fdb144397910c01ebd6dd8ae31e297c1b8b00 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 17:19:00 -0500 Subject: [PATCH 13/50] Simplify code in one place. --- src/EnergyPlus/OutputProcessor.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index a57ee8e3e96..73abaefbe7f 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4623,7 +4623,6 @@ void SetupOutputVariable(EnergyPlusData &state, std::string_view const KeyedValue // Associated Key for this variable ) { - std::string_view ReportFreq = ""; SetupOutputVariable(state, VariableName, // String Name of variable VariableUnit, // Actual units corresponding to the actual variable @@ -4631,7 +4630,7 @@ void SetupOutputVariable(EnergyPlusData &state, TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 VariableTypeKey, // State, Average=1, NonState, Sum=2 KeyedValue, // Associated Key for this variable - ReportFreq // Internal use -- causes reporting at this freqency + {} // Internal use -- causes reporting at this freqency // indexGroupKey // Group identifier for SQL output ); } From 7412ea9d5110acb764204738918baf03569879ff Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 17:20:57 -0500 Subject: [PATCH 14/50] Deal with EMS calling scenario. --- src/EnergyPlus/RuntimeLanguageProcessor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index a1786069fd3..aa4eed02f76 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -3517,7 +3517,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) FreqString, VarTypeString, "EMS", - {}, + "", {}, {}, {}, From 082f48e0f3de09bcbb2b884a21ad3e29955fc960 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 17:22:00 -0500 Subject: [PATCH 15/50] Revise some details on simplified calls. --- src/EnergyPlus/OutputProcessor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 73abaefbe7f..1e68c4b3318 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4287,7 +4287,7 @@ void SetupOutputVariable(EnergyPlusData &state, std::string_view const KeyedValue // Associated Key for this variable ) { - SetupOutputVariable(state, VariableName, VariableUnit, ActualVariable, TimeStepTypeKey, VariableTypeKey, KeyedValue, {}); + SetupOutputVariable(state, VariableName, VariableUnit, ActualVariable, TimeStepTypeKey, VariableTypeKey, KeyedValue, ""); } void SetupOutputVariable(EnergyPlusData &state, @@ -4630,7 +4630,7 @@ void SetupOutputVariable(EnergyPlusData &state, TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 VariableTypeKey, // State, Average=1, NonState, Sum=2 KeyedValue, // Associated Key for this variable - {} // Internal use -- causes reporting at this freqency + "" // Internal use -- causes reporting at this freqency // indexGroupKey // Group identifier for SQL output ); } From a10e46965b827370f07f44426f3b5d863f72c5fe Mon Sep 17 00:00:00 2001 From: jcyuan Date: Tue, 17 Oct 2023 19:20:45 -0500 Subject: [PATCH 16/50] Fix calls from Python Plugin variable setups. --- src/EnergyPlus/PluginManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 7389ba6a34a..8701723cf61 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -201,7 +201,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) sUpdateFreq, sAvgOrSum, thisObjectName, - {}, + "", {}, {}, {}, From d5f1452068f0387d56c612a1edb58166334a0b8f Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 11:43:41 -0500 Subject: [PATCH 17/50] Unit test 1 draft. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 140 ++++++++++++++++++++ 1 file changed, 140 insertions(+) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 8c75f5f5e3e..5c1a284ab70 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6012,6 +6012,146 @@ namespace OutputProcessor { } } + TEST_F(SQLiteFixture, OutputProcessor_SetupOutputVariable_enum) + { + // Test SOV calls for PR 10231 + std::string const idf_objects = delimited_string({ + "Output:Variable,*,Site Outdoor Air Drybulb Temperature,runperiod;", + "Output:Variable,*,Chiller Electricity Energy,runperiod;", + "Output:Variable,*,Lights Electricity Energy,runperiod;", + "Output:Variable,*,Environmental Impact Fuel Oil No 2 CO2 Emissions Mass,runperiod;", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + GetReportVariableInput(*state); + + SetupOutputVariable(*state, + "Site Outdoor Air Drybulb Temperature", + OutputProcessor::Unit::C, + state->dataEnvrn->OutDryBulbTemp, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Average, + "Environment"); + + Real64 cooling_consumption = 0.; + SetupOutputVariable(*state, + "Chiller Electricity Energy", + OutputProcessor::Unit::J, + cooling_consumption, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Cool-1", + {}, + "ELECTRICITY", + "Cooling", + {}, // EndUseSubKey + "Plant"); + + Real64 light_consumption = 0.; + SetupOutputVariable(*state, + "Lights Electricity Energy", + OutputProcessor::Unit::J, + light_consumption, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Summed, + "LIGHTS 1", + {}, + "Electricity", + "InteriorLights", + "RailroadCrossing", // EndUseSubKey + "Building", + "SPACE1-1", + 1, + 1); + + Real64 fuel_oil_co2 = 0.; + SetupOutputVariable(*state, + "Environmental Impact Fuel Oil No 2 CO2 Emissions Mass", + OutputProcessor::Unit::kg, + fuel_oil_co2, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "CO2", + "FuelOilNo2Emissions", + {}, // EndUseSubKey + ""); + + auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); + + EXPECT_EQ(1, state->dataOutputProcessor->NumExtraVars); + + EXPECT_EQ("", state->dataOutputProcessor->ReqRepVars(1).Key); + EXPECT_EQ("SITE OUTDOOR AIR DRYBULB TEMPERATURE", state->dataOutputProcessor->ReqRepVars(1).VarName); + EXPECT_TRUE(compare_enums(ReportingFrequency::Simulation, state->dataOutputProcessor->ReqRepVars(1).frequency)); + EXPECT_EQ(0, state->dataOutputProcessor->ReqRepVars(1).SchedPtr); + EXPECT_EQ("", state->dataOutputProcessor->ReqRepVars(1).SchedName); + EXPECT_EQ(true, state->dataOutputProcessor->ReqRepVars(1).Used); + + EXPECT_TRUE(compare_enums(OutputProcessor::TimeStepType::Zone, state->dataOutputProcessor->DDVariableTypes(1).timeStepType)); + EXPECT_TRUE(compare_enums(StoreType::Averaged, state->dataOutputProcessor->DDVariableTypes(1).storeType)); + EXPECT_TRUE(compare_enums(VariableType::Real, state->dataOutputProcessor->DDVariableTypes(1).variableType)); + EXPECT_EQ(0, state->dataOutputProcessor->DDVariableTypes(1).Next); + EXPECT_FALSE(state->dataOutputProcessor->DDVariableTypes(1).ReportedOnDDFile); + EXPECT_EQ("Site Outdoor Air Drybulb Temperature", state->dataOutputProcessor->DDVariableTypes(1).VarNameOnly); + + int found; + + // Cooling + // testing an ABUPS end use with no sub end use specified + EXPECT_EQ(1, state->dataOutputProcessor->EndUseCategory(2).NumSubcategories); + EXPECT_EQ("General", state->dataOutputProcessor->EndUseCategory(2).SubcategoryName(1)); + + found = UtilityRoutines::FindItem("Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); + EXPECT_NE(0, found); + EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); + EXPECT_EQ("Cooling", state->dataOutputProcessor->EnergyMeters(found).EndUse); + EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); + + found = UtilityRoutines::FindItem("General:Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); + EXPECT_NE(0, found); + EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); + EXPECT_EQ("Cooling", state->dataOutputProcessor->EnergyMeters(found).EndUse); + EXPECT_EQ("General", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); + + // lighting + // testing an ABUPS end use with a sub end use specified + EXPECT_EQ(1, state->dataOutputProcessor->EndUseCategory(3).NumSubcategories); // lighting end use + EXPECT_EQ("RailroadCrossing", state->dataOutputProcessor->EndUseCategory(3).SubcategoryName(1)); + + found = UtilityRoutines::FindItem("InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + EXPECT_NE(0, found); + EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); + EXPECT_EQ("InteriorLights", state->dataOutputProcessor->EnergyMeters(found).EndUse); + EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); + + found = UtilityRoutines::FindItem("General:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + EXPECT_EQ(0, found); // should not find this + + found = UtilityRoutines::FindItem("RailroadCrossing:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + EXPECT_NE(0, found); + EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); + EXPECT_EQ("InteriorLights", state->dataOutputProcessor->EnergyMeters(found).EndUse); + EXPECT_EQ("RailroadCrossing", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); + + // fuel oil CO2 emissions + // testing a non-ABUPS end use with no sub end use specified + found = UtilityRoutines::FindItem("FuelOilNo2Emissions:CO2", state->dataOutputProcessor->EnergyMeters); + EXPECT_NE(0, found); + EXPECT_EQ("CO2", state->dataOutputProcessor->EnergyMeters(found).ResourceType); + EXPECT_EQ("FuelOilNo2Emissions", state->dataOutputProcessor->EnergyMeters(found).EndUse); + EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); + + std::vector> reportDataDictionary( + {{"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, + {"2", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Run Period", "", "J"}, + {"51", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Run Period", "", "J"}, + {"124", "0", "Sum", "System", "HVAC System", "Site", "Environmental Impact Fuel Oil No 2 CO2 Emissions Mass", "Run Period", "", "kg"}}); + EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); + } + } // namespace OutputProcessor } // namespace EnergyPlus From f905d4f5bf51271ccda6d317c649cc4402697aa2 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 12:41:02 -0500 Subject: [PATCH 18/50] C-Lang formatting. --- src/EnergyPlus/OutputProcessor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 1e68c4b3318..509bd0bafd6 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4642,7 +4642,7 @@ void SetupOutputVariable(EnergyPlusData &state, OutputProcessor::SOVTimeStepType const TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 OutputProcessor::SOVStoreType const VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string_view const KeyedValue, // Associated Key for this variable - OutputProcessor::ReportingFrequency const ReportFreq, // Internal use -- causes reporting at this freqency + OutputProcessor::ReportingFrequency const ReportFreq, // Internal use -- causes reporting at this freqency int const indexGroupKey // Group identifier for SQL output ) { From 43b5c30a9d9e498f58e96026ff30c8f0760ce6b7 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 18 Oct 2023 16:33:32 -0500 Subject: [PATCH 19/50] Testfile HeatPumpProportionalControl_DCVDesignOccAllZones.idf --- testfiles/CMakeLists.txt | 1 + ...oportionalControl_DCVDesignOccAllZones.idf | 1815 +++++++++++++++++ 2 files changed, 1816 insertions(+) create mode 100644 testfiles/HeatPumpProportionalControl_DCVDesignOccAllZones.idf diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index efc7d296009..3acb3c1f2f5 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -355,6 +355,7 @@ add_simulation_test(IDF_FILE HeatPumpIAQP_DCV.idf EPW_FILE USA_IL_Chicago-OHare. add_simulation_test(IDF_FILE HeatPumpIAQP_GenericContamControl.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCVDesignRate.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) +add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCVDesignOccAllZones.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE HeatPumpSecondaryCoil.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE HeatPumpSimpleDCV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE HeatPumpVRP_DCV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) diff --git a/testfiles/HeatPumpProportionalControl_DCVDesignOccAllZones.idf b/testfiles/HeatPumpProportionalControl_DCVDesignOccAllZones.idf new file mode 100644 index 00000000000..cbd5e840405 --- /dev/null +++ b/testfiles/HeatPumpProportionalControl_DCVDesignOccAllZones.idf @@ -0,0 +1,1815 @@ +!-Generator IDFEditor 1.34 +!-Option OriginalOrderTop UseSpecialFormat +!-NOTE: All comments with '!-' are ignored by the IDFEditor and are generated automatically. +!- Use '!' comments if they need to be retained when using the IDFEditor. +! HeatPumpProportionalControl_DCVDesignOccAllZones.idf +! Basic file description: Heat pump with DX coil for cooling (w/ 10% outdoor air max.) +! 1 story building divided into 3 interior conditioned zones. Roof with no plenum. +! No ground contact with floor. Outdoor air is modulated based on occupancy and floor area. +! +! Highlights: Example of demand controlled ventilation (see Controller:MechanicalVentilation object). +! Enhance CO2 based DCV control by using Proportional Control Based On Design Occupancy. +! +! Simulation Location/Run: CHICAGO_IL_USA TMY2-94846, 2 design days, 1 run period +! Run Control executes 1 run period(see RUN PERIOD object) +! +! Location: Chicago, IL +! +! Design Days: CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C +! +! Run Period (Weather File): Winter 1/14, Summer 7/7, CHICAGO_IL_USA TMY2-94846 +! +! Run Control: No zone or system sizing, run period using weather file. +! +! Building: Single floor rectangular L-shaped building 40 ft south wall, 40 ft west wall, zone height 10 feet. +! There is a single window in West Zone's south wall. The walls are 1 in stucco over 4 in common brick +! and gypboard. The roof is a built up roof with 1/2 in stone over 3/8 in felt over 1 in dense insulation +! supported by 2 in heavy weight concrete. The window is single pane 3mm clear. +! The window to wall ratio is approximately 0.07. +! +! The building is oriented due north. +! +! Floor Area: 130.1 m2 (1403 ft2) +! Number of Stories: 1 +! +! Zone Description Details: +! +! (0,12.192,0) (9.144,12.192,0) +! ________________________________ +! | | +! | | +! | | +! | | +! | North | +! | | +! | | +! | (6.096,6.096,0) | +! |________________________________|____________ (12.192,6.069,0) +! | (0,6.096,0) | (9.144,6.096,0) | +! | | | +! | | | +! | | | +! | West | East | window = * +! | | | +! | | | +! | | | +! |___**************___|________________________| +! +! (0,0,0) (6.069,0,0) (12.192,0,0) +! +! Internal gains description: ZONE West - lighting is 0 watts, equip is 2928.751 watts, 3 occupants +! Internal gains description: ZONE North - lighting is 878.6252 watts, equip is 2928.751 watts, 4 occupants +! Internal gains description: ZONE East - lighting is 1464.375 watts, equip is 1464.375 watts, 3 occupants +! +! Interzone Surfaces: 3 interzone surfaces (see diagram) +! Internal Mass: None +! People: 10 +! Lights: 2343 W +! Equipment: 7323 W +! Windows: 1 +! Detached Shading: None +! Daylight: None +! Natural Ventilation: None +! Compact Schedules: Yes +! Solair Distribution: FullInteriorAndExterior +! +! HVAC: Heat pump using a single air loop serving 3 zones. Heat pump configured with a +! blow through fan, heat pump defrost is timed using a resistive heating element. +! Heating set point during winter months is 20 C during occupied hours, +! 15 C set-back otherwise. Cooling set point at 24 C during occupied hours only. +! Cooling coil off all winter. Heat Pump has a gas supplemental heater. Outdoor air +! is modulated based on occupancy and floor area according to the following +! schedule (see Controller:MechanicalVentilation object): +! +! Zone: Outdoor Air: +! West Zone 0.000381 m3/s-m2 and 0.002952 m3/s-person +! East Zone 0.000407 m3/s-m2 and 0.003149 m3/s-person +! North Zone 0.000407 m3/s-m2 and 0.003149 m3/s-person +! +! Zonal Equipment: DIRECT AIR +! Central Air Handling Equipment: Yes +! System Equipment Autosize: No +! Purchased Cooling: No +! Purchased Heating: No +! Purchased Chilled Water: No +! Purchased Hot Water: No +! Coils: Coil:Cooling:DX:SingleSpeed, COIL:DX:HeatingEmpirical, Coil:Heating:Fuel +! Pumps: None +! Boilers: None +! Chillers: None +! Towers: None +! +! Results: +! Standard Reports: None +! Timestep or Hourly Variables: Timestep +! Time bins Report: None +! HTML Report: None +! Environmental Emissions: None +! Utility Tariffs: None + + Version,23.2; + + Building, + NONE, !- Name + 0, !- North Axis {deg} + Suburbs, !- Terrain + 3.9999999E-02, !- Loads Convergence Tolerance Value {W} + 0.4000000, !- Temperature Convergence Tolerance Value {deltaC} + FullInteriorAndExterior, !- Solar Distribution + 25, !- Maximum Number of Warmup Days + 6; !- Minimum Number of Warmup Days + + Timestep,6; + + SurfaceConvectionAlgorithm:Inside,TARP; + + SurfaceConvectionAlgorithm:Outside,DOE-2; + + HeatBalanceAlgorithm,ConductionTransferFunction; + + SimulationControl, + No, !- Do Zone Sizing Calculation + No, !- Do System Sizing Calculation + No, !- Do Plant Sizing Calculation + Yes, !- Run Simulation for Sizing Periods + No, !- Run Simulation for Weather File Run Periods + No, !- Do HVAC Sizing Simulation for Sizing Periods + 1; !- Maximum Number of HVAC Sizing Simulation Passes + + RunPeriod, + Run Period 1, !- Name + 7, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 7, !- End Month + 14, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + Site:Location, + CHICAGO_IL_USA TMY2-94846, !- Name + 42.00, !- Latitude {deg} + -87.88, !- Longitude {deg} + -6.00, !- Time Zone {hr} + 190.00; !- Elevation {m} + +! CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, !- Name + 1, !- Month + 25, !- Day of Month + WinterDesignDay, !- Day Type + -17.3, !- Maximum Dry-Bulb Temperature {C} + 0.0, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + -17.3, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 4.9, !- Wind Speed {m/s} + 270, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 0.0; !- Sky Clearness + +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Cooling 1% Design Conditions DB/MCWB, !- Name + 7, !- Month + 25, !- Day of Month + SummerDesignDay, !- Day Type + 31.5, !- Maximum Dry-Bulb Temperature {C} + 10.7, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + 23.0, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 5.3, !- Wind Speed {m/s} + 230, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 1.0; !- Sky Clearness + + Site:GroundTemperature:BuildingSurface,20.03,20.03,20.13,20.30,20.43,20.52,20.62,20.77,20.78,20.55,20.44,20.20; + + ZoneAirContaminantBalance, + Yes, !- Carbon Dioxide Concentration + Outdoor CO2 Schedule; !- Outdoor Carbon Dioxide Schedule Name + + Material, + A1 - 1 IN STUCCO, !- Name + Smooth, !- Roughness + 2.5389841E-02, !- Thickness {m} + 0.6918309, !- Conductivity {W/m-K} + 1858.142, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.9200000, !- Solar Absorptance + 0.9200000; !- Visible Absorptance + + Material, + C4 - 4 IN COMMON BRICK, !- Name + Rough, !- Roughness + 0.1014984, !- Thickness {m} + 0.7264224, !- Conductivity {W/m-K} + 1922.216, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7600000, !- Solar Absorptance + 0.7600000; !- Visible Absorptance + + Material, + E1 - 3 / 4 IN PLASTER OR GYP BOARD, !- Name + Smooth, !- Roughness + 1.9050000E-02, !- Thickness {m} + 0.7264224, !- Conductivity {W/m-K} + 1601.846, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.9200000, !- Solar Absorptance + 0.9200000; !- Visible Absorptance + + Material, + C6 - 8 IN CLAY TILE, !- Name + Smooth, !- Roughness + 0.2033016, !- Thickness {m} + 0.5707605, !- Conductivity {W/m-K} + 1121.292, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.8200000, !- Solar Absorptance + 0.8200000; !- Visible Absorptance + + Material, + C10 - 8 IN HW CONCRETE, !- Name + MediumRough, !- Roughness + 0.2033016, !- Thickness {m} + 1.729577, !- Conductivity {W/m-K} + 2242.585, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material, + E2 - 1 / 2 IN SLAG OR STONE, !- Name + Rough, !- Roughness + 1.2710161E-02, !- Thickness {m} + 1.435549, !- Conductivity {W/m-K} + 881.0155, !- Density {kg/m3} + 1673.600, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.5500000, !- Solar Absorptance + 0.5500000; !- Visible Absorptance + + Material, + E3 - 3 / 8 IN FELT AND MEMBRANE, !- Name + Rough, !- Roughness + 9.5402403E-03, !- Thickness {m} + 0.1902535, !- Conductivity {W/m-K} + 1121.292, !- Density {kg/m3} + 1673.600, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + B5 - 1 IN DENSE INSULATION, !- Name + VeryRough, !- Roughness + 2.5389841E-02, !- Thickness {m} + 4.3239430E-02, !- Conductivity {W/m-K} + 91.30524, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.5000000, !- Solar Absorptance + 0.5000000; !- Visible Absorptance + + Material, + C12 - 2 IN HW CONCRETE, !- Name + MediumRough, !- Roughness + 5.0901599E-02, !- Thickness {m} + 1.729577, !- Conductivity {W/m-K} + 2242.585, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + WindowMaterial:Glazing, + WIN-LAY-GLASS-LIGHT, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.90, !- Solar Transmittance at Normal Incidence + 0.031, !- Front Side Solar Reflectance at Normal Incidence + 0.031, !- Back Side Solar Reflectance at Normal Incidence + 0.90, !- Visible Transmittance at Normal Incidence + 0.05, !- Front Side Visible Reflectance at Normal Incidence + 0.05, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + Construction, + EXTWALL80, !- Name + A1 - 1 IN STUCCO, !- Outside Layer + C4 - 4 IN COMMON BRICK, !- Layer 2 + E1 - 3 / 4 IN PLASTER OR GYP BOARD; !- Layer 3 + + Construction, + PARTITION06, !- Name + E1 - 3 / 4 IN PLASTER OR GYP BOARD, !- Outside Layer + C6 - 8 IN CLAY TILE, !- Layer 2 + E1 - 3 / 4 IN PLASTER OR GYP BOARD; !- Layer 3 + + Construction, + FLOOR SLAB 8 IN, !- Name + C10 - 8 IN HW CONCRETE; !- Outside Layer + + Construction, + ROOF34, !- Name + E2 - 1 / 2 IN SLAG OR STONE, !- Outside Layer + E3 - 3 / 8 IN FELT AND MEMBRANE, !- Layer 2 + B5 - 1 IN DENSE INSULATION, !- Layer 3 + C12 - 2 IN HW CONCRETE; !- Layer 4 + + Construction, + WIN-CON-LIGHT, !- Name + WIN-LAY-GLASS-LIGHT; !- Outside Layer + + Zone, + West Zone, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + autocalculate, !- Ceiling Height {m} + autocalculate; !- Volume {m3} + + Zone, + EAST ZONE, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + autocalculate, !- Ceiling Height {m} + autocalculate; !- Volume {m3} + + Zone, + NORTH ZONE, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + autocalculate, !- Ceiling Height {m} + autocalculate; !- Volume {m3} + + ZoneList, + DCV Zone List, !- Name + East Zone, !- Zone 1 Name + North Zone; !- Zone 2 Name + + GlobalGeometryRules, + UpperLeftCorner, !- Starting Vertex Position + CounterClockWise, !- Vertex Entry Direction + World; !- Coordinate System + + BuildingSurface:Detailed, + Zn001:Wall001, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + West Zone, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,0,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 0,0,0, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,0,0, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,0,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Wall002, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + West Zone, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 0,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 0,0,0, !- X,Y,Z ==> Vertex 3 {m} + 0,0,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Wall003, !- Name + Wall, !- Surface Type + PARTITION06, !- Construction Name + West Zone, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn003:Wall004, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 0,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 0,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Wall004, !- Name + Wall, !- Surface Type + PARTITION06, !- Construction Name + West Zone, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn002:Wall004, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,0,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,0,0, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Flr001, !- Name + Floor, !- Surface Type + FLOOR SLAB 8 IN, !- Construction Name + West Zone, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn001:Flr001, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 1.000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,0,0, !- X,Y,Z ==> Vertex 1 {m} + 0,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,0,0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Roof001, !- Name + Roof, !- Surface Type + ROOF34, !- Construction Name + West Zone, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0, !- View Factor to Ground + 4, !- Number of Vertices + 0,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 0,0,3.048000, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,0,3.048000, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Wall001, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 12.19200,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 12.19200,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 9.144000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 9.144000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Wall002, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,0,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,0,0, !- X,Y,Z ==> Vertex 2 {m} + 12.19200,0,0, !- X,Y,Z ==> Vertex 3 {m} + 12.19200,0,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Wall003, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 12.19200,0,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 12.19200,0,0, !- X,Y,Z ==> Vertex 2 {m} + 12.19200,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 12.19200,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Wall004, !- Name + Wall, !- Surface Type + PARTITION06, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn001:Wall004, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,0,0, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,0,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Wall005, !- Name + Wall, !- Surface Type + PARTITION06, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn003:Wall005, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 9.144000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 9.144000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Flr001, !- Name + Floor, !- Surface Type + FLOOR SLAB 8 IN, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn002:Flr001, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 1.000000, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,0,0, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 12.19200,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 12.19200,0,0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn002:Roof001, !- Name + Roof, !- Surface Type + ROOF34, !- Construction Name + EAST ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,0,3.048000, !- X,Y,Z ==> Vertex 2 {m} + 12.19200,0,3.048000, !- X,Y,Z ==> Vertex 3 {m} + 12.19200,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Wall001, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,12.19200,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 0,12.19200,0, !- X,Y,Z ==> Vertex 2 {m} + 0,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 0,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Wall002, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 9.144000,12.19200,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 9.144000,12.19200,0, !- X,Y,Z ==> Vertex 2 {m} + 0,12.19200,0, !- X,Y,Z ==> Vertex 3 {m} + 0,12.19200,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Wall003, !- Name + Wall, !- Surface Type + EXTWALL80, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 9.144000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 9.144000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 9.144000,12.19200,0, !- X,Y,Z ==> Vertex 3 {m} + 9.144000,12.19200,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Wall004, !- Name + Wall, !- Surface Type + PARTITION06, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn001:Wall003, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 0,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 6.096000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Wall005, !- Name + Wall, !- Surface Type + PARTITION06, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn002:Wall005, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 6.096000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m} + 9.144000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m} + 9.144000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Flr001, !- Name + Floor, !- Surface Type + FLOOR SLAB 8 IN, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + Zn003:Flr001, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 1.000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,6.096000,0, !- X,Y,Z ==> Vertex 1 {m} + 0,12.19200,0, !- X,Y,Z ==> Vertex 2 {m} + 9.144000,12.19200,0, !- X,Y,Z ==> Vertex 3 {m} + 9.144000,6.096000,0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn003:Roof001, !- Name + Roof, !- Surface Type + ROOF34, !- Construction Name + NORTH ZONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0, !- View Factor to Ground + 4, !- Number of Vertices + 0,12.19200,3.048000, !- X,Y,Z ==> Vertex 1 {m} + 0,6.096000,3.048000, !- X,Y,Z ==> Vertex 2 {m} + 9.144000,6.096000,3.048000, !- X,Y,Z ==> Vertex 3 {m} + 9.144000,12.19200,3.048000; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + Zn001:Wall001:Win001, !- Name + Window, !- Surface Type + WIN-CON-LIGHT, !- Construction Name + Zn001:Wall001, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.5000000, !- View Factor to Ground + , !- Frame and Divider Name + 1.0, !- Multiplier + 4, !- Number of Vertices + 0.548000,0,2.5000, !- X,Y,Z ==> Vertex 1 {m} + 0.548000,0,0.5000, !- X,Y,Z ==> Vertex 2 {m} + 5.548000,0,0.5000, !- X,Y,Z ==> Vertex 3 {m} + 5.548000,0,2.5000; !- X,Y,Z ==> Vertex 4 {m} + + ScheduleTypeLimits, + Any Number; !- Name + + ScheduleTypeLimits, + Fraction, !- Name + 0.0, !- Lower Limit Value + 1.0, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + ScheduleTypeLimits, + Temperature, !- Name + -60, !- Lower Limit Value + 200, !- Upper Limit Value + CONTINUOUS, !- Numeric Type + Temperature; !- Unit Type + + ScheduleTypeLimits, + Control Type, !- Name + 0, !- Lower Limit Value + 4, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + On/Off, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + DISCRETE; !- Numeric Type + + Schedule:Compact, + ZoneADEffSch, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Saturday Sunday Holiday, !- Field 2 + Until: 24:00,1.0, !- Field 3 + For: AllOtherDays, !- Field 5 + Until: 5:00,1.0, !- Field 6 + Until: 18:30,1.0, !- Field 8 + Until: 24:00,1.0; !- Field 10 + + Schedule:Compact, + VentSchedule, !- Name + On/Off, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Saturday Sunday Holiday, !- Field 2 + Until: 24:00,0, !- Field 3 + For: AllOtherDays, !- Field 5 + Until: 5:00,0, !- Field 6 + Until: 18:30,1, !- Field 8 + Until: 24:00,0; !- Field 10 + + Schedule:Compact, + Activity Sch, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,131.8; !- Field 3 + + Schedule:Compact, + Work Eff Sch, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,0.0; !- Field 3 + + Schedule:Compact, + Clothing Sch, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + Air Velo Sch, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,0.137; !- Field 3 + + Schedule:Compact, + OFFICE OCCUPANCY, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay, !- Field 2 + Until: 6:00,0.0, !- Field 3 + Until: 7:00,0.10, !- Field 5 + Until: 8:00,0.50, !- Field 7 + Until: 12:00,1.00, !- Field 9 + Until: 13:00,0.50, !- Field 11 + Until: 16:00,1.00, !- Field 13 + Until: 17:00,0.50, !- Field 15 + Until: 18:00,0.10, !- Field 17 + Until: 24:00,0.0, !- Field 19 + For: AllOtherDays, !- Field 21 + Until: 24:00,0.0; !- Field 22 + + Schedule:Compact, + INTERMITTENT, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay, !- Field 2 + Until: 8:00,0.0, !- Field 3 + Until: 18:00,1.00, !- Field 5 + Until: 24:00,0.0, !- Field 7 + For: AllOtherDays, !- Field 9 + Until: 24:00,0.0; !- Field 10 + + Schedule:Compact, + OFFICE LIGHTING, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay, !- Field 2 + Until: 6:00,0.05, !- Field 3 + Until: 7:00,0.20, !- Field 5 + Until: 17:00,1.00, !- Field 7 + Until: 18:00,0.50, !- Field 9 + Until: 24:00,0.05, !- Field 11 + For: AllOtherDays, !- Field 13 + Until: 24:00,0.05; !- Field 14 + + Schedule:Compact, + OutdoorAirAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 9/30, !- Field 5 + For: WeekDays, !- Field 6 + Until: 7:00,0.0, !- Field 7 + Until: 17:00,1.0, !- Field 9 + Until: 24:00,0.0, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,0.0, !- Field 14 + For: AllOtherDays, !- Field 16 + Until: 24:00,0.0, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.0; !- Field 21 + + Schedule:Compact, + OAFractionSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 7:00,0.0, !- Field 3 + Until: 17:00,1.0, !- Field 5 + Until: 24:00,0.0; !- Field 7 + + Schedule:Compact, + FanAndCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 9/30, !- Field 5 + For: WeekDays, !- Field 6 + Until: 7:00,0.0, !- Field 7 + Until: 17:00,1.0, !- Field 9 + Until: 24:00,0.0, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,1.0, !- Field 14 + For: AllOtherDays, !- Field 16 + Until: 24:00,0.0, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.0; !- Field 21 + + Schedule:Compact, + Heating Setpoints, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 7:00,15.0, !- Field 3 + Until: 17:00,20.0, !- Field 5 + Until: 24:00,15.0; !- Field 7 + + Schedule:Compact, + Cooling Setpoints, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 7:00,30.0, !- Field 3 + Until: 17:00,24.0, !- Field 5 + Until: 24:00,30.0; !- Field 7 + + Schedule:Compact, + Zone Control Type Sched, !- Name + Control Type, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1, !- Field 3 + Through: 9/30, !- Field 5 + For: AllDays, !- Field 6 + Until: 24:00,2, !- Field 7 + Through: 12/31, !- Field 9 + For: AllDays, !- Field 10 + Until: 24:00,1; !- Field 11 + + Schedule:Compact, + ContinuousFanSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + Outdoor CO2 Schedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,400.0; !- Field 3 + + Schedule:Compact, + CO2AvailSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + CO2SetpointSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,900.0; !- Field 3 + + Schedule:Compact, + CO2MinSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,300.0; !- Field 3 + + Schedule:Compact, + CO2MaxSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,900.0; !- Field 3 + + Schedule:Compact, + INF-SCHED, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + CO2 Source Schedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + Minimum Outdoor Air Flow Rate Schedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,0.01; !- Field 3 + + People, + WestPeople, !- Name + West Zone, !- Zone or ZoneList or Space or SpaceList Name + OFFICE OCCUPANCY, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 3.000000, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3000000, !- Fraction Radiant + , !- Sensible Heat Fraction + Activity Sch, !- Activity Level Schedule Name + 3.82E-8, !- Carbon Dioxide Generation Rate {m3/s-W} + , !- Enable ASHRAE 55 Comfort Warnings + zoneaveraged, !- Mean Radiant Temperature Calculation Type + , !- Surface Name/Angle Factor List Name + Work Eff Sch, !- Work Efficiency Schedule Name + ClothingInsulationSchedule, !- Clothing Insulation Calculation Method + , !- Clothing Insulation Calculation Method Schedule Name + Clothing Sch, !- Clothing Insulation Schedule Name + Air Velo Sch, !- Air Velocity Schedule Name + FANGER; !- Thermal Comfort Model 1 Type + + People, + EastPeople, !- Name + EAST ZONE, !- Zone or ZoneList or Space or SpaceList Name + OFFICE OCCUPANCY, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 3.000000, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3000000, !- Fraction Radiant + , !- Sensible Heat Fraction + Activity Sch, !- Activity Level Schedule Name + 3.82E-8, !- Carbon Dioxide Generation Rate {m3/s-W} + , !- Enable ASHRAE 55 Comfort Warnings + zoneaveraged, !- Mean Radiant Temperature Calculation Type + , !- Surface Name/Angle Factor List Name + Work Eff Sch, !- Work Efficiency Schedule Name + ClothingInsulationSchedule, !- Clothing Insulation Calculation Method + , !- Clothing Insulation Calculation Method Schedule Name + Clothing Sch, !- Clothing Insulation Schedule Name + Air Velo Sch, !- Air Velocity Schedule Name + FANGER; !- Thermal Comfort Model 1 Type + + People, + NorthPeople, !- Name + NORTH ZONE, !- Zone or ZoneList or Space or SpaceList Name + OFFICE OCCUPANCY, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 4.000000, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3000000, !- Fraction Radiant + , !- Sensible Heat Fraction + Activity Sch, !- Activity Level Schedule Name + 3.82E-8, !- Carbon Dioxide Generation Rate {m3/s-W} + , !- Enable ASHRAE 55 Comfort Warnings + zoneaveraged, !- Mean Radiant Temperature Calculation Type + , !- Surface Name/Angle Factor List Name + Work Eff Sch, !- Work Efficiency Schedule Name + ClothingInsulationSchedule, !- Clothing Insulation Calculation Method + , !- Clothing Insulation Calculation Method Schedule Name + Clothing Sch, !- Clothing Insulation Schedule Name + Air Velo Sch, !- Air Velocity Schedule Name + FANGER; !- Thermal Comfort Model 1 Type + + Lights, + EAST ZONE Lights 1, !- Name + EAST ZONE, !- Zone or ZoneList or Space or SpaceList Name + OFFICE LIGHTING, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 1464.375, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Return Air Fraction + 0.2000000, !- Fraction Radiant + 0.2000000, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Lights, + NORTH ZONE Lights 1, !- Name + NORTH ZONE, !- Zone or ZoneList or Space or SpaceList Name + OFFICE LIGHTING, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 878.6252, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Return Air Fraction + 0.2000000, !- Fraction Radiant + 0.2000000, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + West Zone ElecEq 1, !- Name + West Zone, !- Zone or ZoneList or Space or SpaceList Name + INTERMITTENT, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 2928.751, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3000000, !- Fraction Radiant + 0; !- Fraction Lost + + ElectricEquipment, + EAST ZONE ElecEq 1, !- Name + EAST ZONE, !- Zone or ZoneList or Space or SpaceList Name + INTERMITTENT, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1464.375, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3000000, !- Fraction Radiant + 0; !- Fraction Lost + + ElectricEquipment, + NORTH ZONE ElecEq 1, !- Name + NORTH ZONE, !- Zone or ZoneList or Space or SpaceList Name + INTERMITTENT, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 2928.751, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3000000, !- Fraction Radiant + 0; !- Fraction Lost + + ZoneInfiltration:DesignFlowRate, + WEST ZONE Infil 1, !- Name + West Zone, !- Zone or ZoneList or Space or SpaceList Name + INF-SCHED, !- Schedule Name + AirChanges/Hour, !- Design Flow Rate Calculation Method + , !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + 0.10, !- Air Changes per Hour {1/hr} + 1, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + ZoneInfiltration:DesignFlowRate, + EAST ZONE Infil 1, !- Name + East Zone, !- Zone or ZoneList or Space or SpaceList Name + INF-SCHED, !- Schedule Name + AirChanges/Hour, !- Design Flow Rate Calculation Method + , !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + 0.10, !- Air Changes per Hour {1/hr} + 1, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + ZoneInfiltration:DesignFlowRate, + NORTH ZONE Infil 1, !- Name + NORTH Zone, !- Zone or ZoneList or Space or SpaceList Name + INF-SCHED, !- Schedule Name + AirChanges/Hour, !- Design Flow Rate Calculation Method + , !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + 0.10, !- Air Changes per Hour {1/hr} + 1, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + ZoneContaminantSourceAndSink:CarbonDioxide, + NORTH ZONE CO2, !- Name + NORTH ZONE, !- Zone Name + 1.0E-7, !- Design Generation Rate {m3/s} + CO2 Source Schedule; !- Schedule Name + + Curve:Biquadratic, + HPACCoolCapFT, !- Name + 0.766956, !- Coefficient1 Constant + 0.0107756, !- Coefficient2 x + -0.0000414703, !- Coefficient3 x**2 + 0.00134961, !- Coefficient4 y + -0.000261144, !- Coefficient5 y**2 + 0.000457488, !- Coefficient6 x*y + 12.77778, !- Minimum Value of x + 23.88889, !- Maximum Value of x + 18.0, !- Minimum Value of y + 46.11111, !- Maximum Value of y + , !- Minimum Curve Output + , !- Maximum Curve Output + Temperature, !- Input Unit Type for X + Temperature, !- Input Unit Type for Y + Dimensionless; !- Output Unit Type + + Curve:Biquadratic, + HPACCOOLEIRFT, !- Name + 0.297145, !- Coefficient1 Constant + 0.0430933, !- Coefficient2 x + -0.000748766, !- Coefficient3 x**2 + 0.00597727, !- Coefficient4 y + 0.000482112, !- Coefficient5 y**2 + -0.000956448, !- Coefficient6 x*y + 12.77778, !- Minimum Value of x + 23.88889, !- Maximum Value of x + 18.0, !- Minimum Value of y + 46.11111, !- Maximum Value of y + , !- Minimum Curve Output + , !- Maximum Curve Output + Temperature, !- Input Unit Type for X + Temperature, !- Input Unit Type for Y + Dimensionless; !- Output Unit Type + + Curve:Cubic, + HPACHeatCapFT, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 0.0000034992, !- Coefficient4 x**3 + -20.0, !- Minimum Value of x + 20.0, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Temperature, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Cubic, + HPACHeatCapFFF, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0.0, !- Coefficient3 x**2 + 0.0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + + Curve:Cubic, + HPACHeatEIRFT, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -0.000023328, !- Coefficient4 x**3 + -20.0, !- Minimum Value of x + 20.0, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Temperature, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Quadratic, + HPACCoolCapFFF, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0.0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + + Curve:Quadratic, + HPACCOOLEIRFFF, !- Name + 1.156, !- Coefficient1 Constant + -0.1816, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + + Curve:Quadratic, + HPACCOOLPLFFPLR, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0.0, !- Coefficient3 x**2 + 0.0, !- Minimum Value of x + 1.0; !- Maximum Value of x + + Curve:Quadratic, + HPACHeatEIRFFF, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0.0, !- Minimum Value of x + 1.0; !- Maximum Value of x + + NodeList, + OutsideAirInletNodes, !- Name + Outside Air Inlet Node; !- Node 1 Name + + NodeList, + Zone1Inlets, !- Name + Zone 1 Inlet Node; !- Node 1 Name + + NodeList, + Zone2Inlets, !- Name + Zone 2 Inlet Node; !- Node 1 Name + + NodeList, + Zone3Inlets, !- Name + Zone 3 Inlet Node; !- Node 1 Name + + NodeList, + West Zone List, !- Name + Zone 1 Node; !- Node 1 Name + + NodeList, + East Zone List, !- Name + Zone 2 Node; !- Node 1 Name + + NodeList, + North Zone List, !- Name + Zone 3 Node; !- Node 1 Name + + BranchList, + Air Loop Branches, !- Name + Air Loop Main Branch; !- Branch 1 Name + + Branch, + Air Loop Main Branch, !- Name + , !- Pressure Drop Curve Name + AirLoopHVAC:OutdoorAirSystem, !- Component 1 Object Type + OA Sys 1, !- Component 1 Name + Outdoor Air Mixer Inlet Node, !- Component 1 Inlet Node Name + Mixed Air Node, !- Component 1 Outlet Node Name + AirLoopHVAC:UnitaryHeatPump:AirToAir, !- Component 2 Object Type + DXAC Heat Pump 1, !- Component 2 Name + Mixed Air Node, !- Component 2 Inlet Node Name + Air Loop Outlet Node; !- Component 2 Outlet Node Name + + AirLoopHVAC, + Typical Terminal Reheat 1, !- Name + , !- Controller List Name + Heat Pump 1 Avail List, !- Availability Manager List Name + 1.7, !- Design Supply Air Flow Rate {m3/s} + Air Loop Branches, !- Branch List Name + , !- Connector List Name + Outdoor Air Mixer Inlet Node, !- Supply Side Inlet Node Name + Return Air Mixer Outlet, !- Demand Side Outlet Node Name + Zone Equipment Inlet Node, !- Demand Side Inlet Node Names + Air Loop Outlet Node; !- Supply Side Outlet Node Names + + AirLoopHVAC:ControllerList, + OA Sys 1 Controllers, !- Name + Controller:OutdoorAir, !- Controller 1 Object Type + OA Controller 1; !- Controller 1 Name + + AirLoopHVAC:OutdoorAirSystem:EquipmentList, + OA Sys 1 Equipment, !- Name + OutdoorAir:Mixer, !- Component 1 Object Type + OA Mixing Box 1; !- Component 1 Name + + AirLoopHVAC:OutdoorAirSystem, + OA Sys 1, !- Name + OA Sys 1 Controllers, !- Controller List Name + OA Sys 1 Equipment; !- Outdoor Air Equipment List Name + + OutdoorAir:NodeList, + OutsideAirInletNodes; !- Node or NodeList Name 1 + + OutdoorAir:Mixer, + OA Mixing Box 1, !- Name + Mixed Air Node, !- Mixed Air Node Name + Outside Air Inlet Node, !- Outdoor Air Stream Node Name + Relief Air Outlet Node, !- Relief Air Stream Node Name + Outdoor Air Mixer Inlet Node; !- Return Air Stream Node Name + + AvailabilityManagerAssignmentList, + Heat Pump 1 Avail List, !- Name + AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type + Heat Pump 1 Avail; !- Availability Manager 1 Name + + AvailabilityManagerAssignmentList, + Outdoor Air 1 Avail List,!- Name + AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type + Outdoor Air 1 Avail; !- Availability Manager 1 Name + + AvailabilityManager:Scheduled, + Heat Pump 1 Avail, !- Name + FanAndCoilAvailSched; !- Schedule Name + + AvailabilityManager:Scheduled, + Outdoor Air 1 Avail, !- Name + OutdoorAirAvailSched; !- Schedule Name + + Controller:OutdoorAir, + OA Controller 1, !- Name + Relief Air Outlet Node, !- Relief Air Outlet Node Name + Outdoor Air Mixer Inlet Node, !- Return Air Node Name + Mixed Air Node, !- Mixed Air Node Name + Outside Air Inlet Node, !- Actuator Node Name + 0.0, !- Minimum Outdoor Air Flow Rate {m3/s} + 1.7, !- Maximum Outdoor Air Flow Rate {m3/s} + NoEconomizer, !- Economizer Control Type + ModulateFlow, !- Economizer Control Action Type + , !- Economizer Maximum Limit Dry-Bulb Temperature {C} + , !- Economizer Maximum Limit Enthalpy {J/kg} + , !- Economizer Maximum Limit Dewpoint Temperature {C} + , !- Electronic Enthalpy Limit Curve Name + , !- Economizer Minimum Limit Dry-Bulb Temperature {C} + NoLockout, !- Lockout Type + FixedMinimum, !- Minimum Limit Type + OAFractionSched, !- Minimum Outdoor Air Schedule Name + , !- Minimum Fraction of Outdoor Air Schedule Name + , !- Maximum Fraction of Outdoor Air Schedule Name + DCVObject; !- Mechanical Ventilation Controller Name + + Controller:MechanicalVentilation, + DCVObject, !- Name + VentSchedule, !- Availability Schedule Name + Yes, !- Demand Controlled Ventilation + ProportionalControlBasedOnDesignOccupancy, !- System Outdoor Air Method + , !- Zone Maximum Outdoor Air Fraction {dimensionless} + West Zone, !- Zone or ZoneList 1 Name + CM DSOA West Zone, !- Design Specification Outdoor Air Object Name 1 + CM DSZAD West Zone, !- Design Specification Zone Air Distribution Object Name 1 + DCV Zone List, !- Zone or ZoneList 2 Name + CM DSOA DCV Zone List, !- Design Specification Outdoor Air Object Name 2 + CM DSZAD DCV Zone List; !- Design Specification Zone Air Distribution Object Name 2 + + DesignSpecification:ZoneAirDistribution, + CM DSZAD West Zone, !- Name + , !- Zone Air Distribution Effectiveness in Cooling Mode {dimensionless} + , !- Zone Air Distribution Effectiveness in Heating Mode {dimensionless} + ZoneADEffSch; !- Zone Air Distribution Effectiveness Schedule Name + + DesignSpecification:ZoneAirDistribution, + CM DSZAD DCV Zone List, !- Name + 0.9, !- Zone Air Distribution Effectiveness in Cooling Mode {dimensionless} + 1.1, !- Zone Air Distribution Effectiveness in Heating Mode {dimensionless} + ; !- Zone Air Distribution Effectiveness Schedule Name + + DesignSpecification:OutdoorAir, + CM DSOA West Zone, !- Name + Sum, !- Outdoor Air Method + 0.002952, !- Outdoor Air Flow per Person {m3/s-person} + 0.000381, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + , !- Outdoor Air Flow per Zone {m3/s} + , !- Outdoor Air Flow Air Changes per Hour {1/hr} + , !- Outdoor Air Schedule Name + Minimum Outdoor Air Flow Rate Schedule; !- Proportional Control Minimum Outdoor Air Flow Rate Schedule Name + + DesignSpecification:OutdoorAir, + CM DSOA DCV Zone List, !- Name + Sum, !- Outdoor Air Method + 0.003149, !- Outdoor Air Flow per Person {m3/s-person} + 0.000407; !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + + ZoneHVAC:EquipmentConnections, + West Zone, !- Zone Name + Zone1Equipment, !- Zone Conditioning Equipment List Name + Zone1Inlets, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 1 Node, !- Zone Air Node Name + Zone 1 Outlet Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + EAST ZONE, !- Zone Name + Zone2Equipment, !- Zone Conditioning Equipment List Name + Zone2Inlets, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 2 Node, !- Zone Air Node Name + Zone 2 Outlet Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + NORTH ZONE, !- Zone Name + Zone3Equipment, !- Zone Conditioning Equipment List Name + Zone3Inlets, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 3 Node, !- Zone Air Node Name + Zone 3 Outlet Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentList, + Zone1Equipment, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone1DirectAir ADU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + Zone2Equipment, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone2DirectAir ADU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + Zone3Equipment, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone3DirectAir ADU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + AirLoopHVAC:UnitaryHeatPump:AirToAir, + DXAC Heat Pump 1, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + Mixed Air Node, !- Air Inlet Node Name + Air Loop Outlet Node, !- Air Outlet Node Name + 1.7, !- Cooling Supply Air Flow Rate {m3/s} + 1.7, !- Heating Supply Air Flow Rate {m3/s} + 1.7, !- No Load Supply Air Flow Rate {m3/s} + East Zone, !- Controlling Zone or Thermostat Location + Fan:OnOff, !- Supply Air Fan Object Type + Supply Fan 1, !- Supply Air Fan Name + Coil:Heating:DX:SingleSpeed, !- Heating Coil Object Type + Heat Pump DX Heating Coil 1, !- Heating Coil Name + Coil:Cooling:DX:SingleSpeed, !- Cooling Coil Object Type + Heat Pump ACDXCoil 1, !- Cooling Coil Name + Coil:Heating:Fuel, !- Supplemental Heating Coil Object Type + Heat Pump DX Supp Heating Coil 1, !- Supplemental Heating Coil Name + 50, !- Maximum Supply Air Temperature from Supplemental Heater {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + BlowThrough, !- Fan Placement + ContinuousFanSchedule; !- Supply Air Fan Operating Mode Schedule Name + + AirTerminal:SingleDuct:ConstantVolume:NoReheat, + Zone1DirectAir, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + Zone 1 Inlet Node ATInlet, !- Air Inlet Node Name + Zone 1 Inlet Node, !- Air Outlet Node Name + 0.612, !- Maximum Air Flow Rate {m3/s} + , !- Design Specification Outdoor Air Object Name + ; !- Per Person Ventilation Rate Mode + + ZoneHVAC:AirDistributionUnit, + Zone1DirectAir ADU, !- Name + Zone 1 Inlet Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:ConstantVolume:NoReheat, !- Air Terminal Object Type + Zone1DirectAir, !- Air Terminal Name + , !- Nominal Upstream Leakage Fraction + , !- Constant Downstream Leakage Fraction + ; !- Design Specification Air Terminal Sizing Object Name + + AirTerminal:SingleDuct:ConstantVolume:NoReheat, + Zone2DirectAir, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + Zone 2 Inlet Node ATInlet, !- Air Inlet Node Name + Zone 2 Inlet Node, !- Air Outlet Node Name + 0.476, !- Maximum Air Flow Rate {m3/s} + , !- Design Specification Outdoor Air Object Name + ; !- Per Person Ventilation Rate Mode + + ZoneHVAC:AirDistributionUnit, + Zone2DirectAir ADU, !- Name + Zone 2 Inlet Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:ConstantVolume:NoReheat, !- Air Terminal Object Type + Zone2DirectAir, !- Air Terminal Name + , !- Nominal Upstream Leakage Fraction + , !- Constant Downstream Leakage Fraction + ; !- Design Specification Air Terminal Sizing Object Name + + AirTerminal:SingleDuct:ConstantVolume:NoReheat, + Zone3DirectAir, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + Zone 3 Inlet Node ATInlet, !- Air Inlet Node Name + Zone 3 Inlet Node, !- Air Outlet Node Name + 0.612, !- Maximum Air Flow Rate {m3/s} + , !- Design Specification Outdoor Air Object Name + ; !- Per Person Ventilation Rate Mode + + ZoneHVAC:AirDistributionUnit, + Zone3DirectAir ADU, !- Name + Zone 3 Inlet Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:ConstantVolume:NoReheat, !- Air Terminal Object Type + Zone3DirectAir, !- Air Terminal Name + , !- Nominal Upstream Leakage Fraction + , !- Constant Downstream Leakage Fraction + ; !- Design Specification Air Terminal Sizing Object Name + + ZoneControl:Thermostat, + Zone 2 Thermostat, !- Name + EAST ZONE, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleHeating, !- Control 1 Object Type + Heating Setpoint with SB,!- Control 1 Name + ThermostatSetpoint:SingleCooling, !- Control 2 Object Type + Cooling Setpoint with SB;!- Control 2 Name + + ThermostatSetpoint:SingleHeating, + Heating Setpoint with SB,!- Name + Heating Setpoints; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleCooling, + Cooling Setpoint with SB,!- Name + Cooling Setpoints; !- Setpoint Temperature Schedule Name + + ZoneControl:ContaminantController, + CO2 Controller1, !- Name + EAST ZONE, !- Zone Name + CO2AvailSchedule, !- Carbon Dioxide Control Availability Schedule Name + CO2SetpointSchedule, !- Carbon Dioxide Setpoint Schedule Name + CO2MinSchedule, !- Minimum Carbon Dioxide Concentration Schedule Name + CO2MaxSchedule; !- Maximum Carbon Dioxide Concentration Schedule Name + + ZoneControl:ContaminantController, + CO2 Controller2, !- Name + WEST ZONE, !- Zone Name + CO2AvailSchedule, !- Carbon Dioxide Control Availability Schedule Name + CO2SetpointSchedule, !- Carbon Dioxide Setpoint Schedule Name + CO2MinSchedule, !- Minimum Carbon Dioxide Concentration Schedule Name + CO2MaxSchedule; !- Maximum Carbon Dioxide Concentration Schedule Name + + ZoneControl:ContaminantController, + CO2 Controller3, !- Name + NORTH ZONE, !- Zone Name + CO2AvailSchedule, !- Carbon Dioxide Control Availability Schedule Name + CO2SetpointSchedule, !- Carbon Dioxide Setpoint Schedule Name + CO2MinSchedule, !- Minimum Carbon Dioxide Concentration Schedule Name + CO2MaxSchedule; !- Maximum Carbon Dioxide Concentration Schedule Name + + AirLoopHVAC:SupplyPath, + HeatPumpSupplyPath, !- Name + Zone Equipment Inlet Node, !- Supply Air Path Inlet Node Name + AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type + Zone Supply Air Splitter;!- Component 1 Name + + AirLoopHVAC:ReturnPath, + HeatPumpReturnPath, !- Name + Return Air Mixer Outlet, !- Return Air Path Outlet Node Name + AirLoopHVAC:ZoneMixer, !- Component 1 Object Type + Zone Return Air Mixer; !- Component 1 Name + + AirLoopHVAC:ZoneSplitter, + Zone Supply Air Splitter,!- Name + Zone Equipment Inlet Node, !- Inlet Node Name + Zone 1 Inlet Node ATInlet, !- Outlet 1 Node Name + Zone 2 Inlet Node ATInlet, !- Outlet 2 Node Name + Zone 3 Inlet Node ATInlet; !- Outlet 3 Node Name + + AirLoopHVAC:ZoneMixer, + Zone Return Air Mixer, !- Name + Return Air Mixer Outlet, !- Outlet Node Name + Zone 1 Outlet Node, !- Inlet 1 Node Name + Zone 2 Outlet Node, !- Inlet 2 Node Name + Zone 3 Outlet Node; !- Inlet 3 Node Name + + Coil:Heating:Fuel, + Heat Pump DX Supp Heating Coil 1, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + NaturalGas, !- Fuel Type + 0.8, !- Burner Efficiency + 32000, !- Nominal Capacity {W} + SuppHeating Coil Air Inlet Node, !- Air Inlet Node Name + Air Loop Outlet Node; !- Air Outlet Node Name + + Coil:Cooling:DX:SingleSpeed, + Heat Pump ACDXCoil 1, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + 32000, !- Gross Rated Total Cooling Capacity {W} + 0.75, !- Gross Rated Sensible Heat Ratio + 3.0, !- Gross Rated Cooling COP {W/W} + 1.7, !- Rated Air Flow Rate {m3/s} + , !- Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)} + 934.4, !- 2023 Rated Evaporator Fan Power Per Volume Flow {W/(m3/s)} + DX Cooling Coil Air Inlet Node, !- Air Inlet Node Name + Heating Coil Air Inlet Node, !- Air Outlet Node Name + HPACCoolCapFT, !- Total Cooling Capacity Function of Temperature Curve Name + HPACCoolCapFFF, !- Total Cooling Capacity Function of Flow Fraction Curve Name + HPACCOOLEIRFT, !- Energy Input Ratio Function of Temperature Curve Name + HPACCOOLEIRFFF, !- Energy Input Ratio Function of Flow Fraction Curve Name + HPACCOOLPLFFPLR; !- Part Load Fraction Correlation Curve Name + + Coil:Heating:DX:SingleSpeed, + Heat Pump DX Heating Coil 1, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + 35000, !- Gross Rated Heating Capacity {W} + 2.75, !- Gross Rated Heating COP {W/W} + 1.7, !- Rated Air Flow Rate {m3/s} + , !- Rated Supply Fan Power Per Volume Flow Rate {W/(m3/s)} + 934.4, !- 2023 Rated Evaporator Fan Power Per Volume Flow {W/(m3/s)} + Heating Coil Air Inlet Node, !- Air Inlet Node Name + SuppHeating Coil Air Inlet Node, !- Air Outlet Node Name + HPACHeatCapFT, !- Heating Capacity Function of Temperature Curve Name + HPACHeatCapFFF, !- Heating Capacity Function of Flow Fraction Curve Name + HPACHeatEIRFT, !- Energy Input Ratio Function of Temperature Curve Name + HPACHeatEIRFFF, !- Energy Input Ratio Function of Flow Fraction Curve Name + HPACCOOLPLFFPLR, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + -5.0, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Outdoor Dry-Bulb Temperature to Turn On Compressor {C} + 5.0, !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + 200.0, !- Crankcase Heater Capacity {W} + , !- Crankcase Heater Capacity Function of Temperature Curve Name + 10.0, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + TIMED, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 20000; !- Resistive Defrost Heater Capacity {W} + + Fan:OnOff, + Supply Fan 1, !- Name + FanAndCoilAvailSched, !- Availability Schedule Name + 0.7, !- Fan Total Efficiency + 300.0, !- Pressure Rise {Pa} + 1.7, !- Maximum Flow Rate {m3/s} + 0.9, !- Motor Efficiency + 1.0, !- Motor In Airstream Fraction + Mixed Air Node, !- Air Inlet Node Name + DX Cooling Coil Air Inlet Node; !- Air Outlet Node Name + + Output:Variable,*,Unitary System Fan Part Load Ratio,timestep; + + Output:Variable,*,Unitary System Compressor Part Load Ratio,timestep; + + Output:Variable,*,Zone Air System Sensible Heating Energy,timestep; + + Output:Variable,*,Zone Air System Sensible Cooling Energy,timestep; + + Output:Variable,*,Zone Air Temperature,timestep; + + Output:Variable,*,Zone Air Relative Humidity,timestep; + + Output:Variable,*,Zone Air Humidity Ratio,timestep; + + Output:Variable,*,Fan Electricity Rate,timestep; + + Output:Variable,*,Cooling Coil Total Cooling Energy,timestep; + + Output:Variable,*,Cooling Coil Sensible Cooling Rate,timestep; + + Output:Variable,*,Cooling Coil Sensible Cooling Energy,timestep; + + Output:Variable,*,Cooling Coil Electricity Rate,timestep; + + Output:Variable,*,Heating Coil Heating Rate,timestep; + + Output:Variable,*,Heating Coil Heating Energy,timestep; + + Output:Variable,*,Heating Coil Electricity Rate,timestep; + + Output:Variable,*,Heating Coil Defrost Electricity Rate,timestep; + + Output:Variable,*,Heating Coil NaturalGas Rate,timestep; + + Output:Variable,*,Heating Coil Defrost Electricity Energy,timestep; + + Output:Variable,Outside Air Inlet Node,System Node Mass Flow Rate,timestep; + + Output:Variable,*,Zone People Occupant Count,timestep; + + Output:Variable,*,System Node CO2 Concentration,timestep; + + Output:Variable,*,Zone Air CO2 Concentration,timestep; + + Output:Variable,*,Zone Air CO2 Predicted Load to Setpoint Mass Flow Rate,timestep; + + Output:Variable,*,Air System Outdoor Air Mass Flow Rate,timestep; + + Output:Meter:MeterFileOnly,Electricity:Facility,monthly; + + Output:Meter:MeterFileOnly,Electricity:Building,monthly; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,monthly; + + Output:Meter:MeterFileOnly,Electricity:HVAC,monthly; + + Output:Meter:MeterFileOnly,NaturalGas:Facility,monthly; + + Output:Meter:MeterFileOnly,NaturalGas:HVAC,monthly; + + Output:Meter:MeterFileOnly,Electricity:Facility,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Building,runperiod; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,runperiod; + + Output:Meter:MeterFileOnly,Electricity:HVAC,runperiod; + + Output:Meter:MeterFileOnly,NaturalGas:Facility,runperiod; + + Output:Meter:MeterFileOnly,NaturalGas:HVAC,runperiod; + + Output:VariableDictionary,Regular; + + Output:Surfaces:Drawing,dxf; + + Output:Constructions,Constructions; + + OutputControl:Table:Style, + HTML; !- Column Separator + + Output:Table:SummaryReports, + AllSummary; !- Report 1 Name + From 2e9dd715037567094e524432c6a9b9e3c97858bb Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 17:38:19 -0500 Subject: [PATCH 20/50] Unit test 1 revisions. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 5c1a284ab70..3f469dd6e9e 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6042,9 +6042,9 @@ namespace OutputProcessor { OutputProcessor::SOVTimeStepType::System, OutputProcessor::SOVStoreType::Summed, "Cool-1", - {}, - "ELECTRICITY", - "Cooling", + {}, // OutputProcessor::ReportingFrequency ReportFreq, + Constant::eResource::Electricity, + Constant::EndUse::Cooling, {}, // EndUseSubKey "Plant"); @@ -6057,8 +6057,8 @@ namespace OutputProcessor { OutputProcessor::SOVStoreType::Summed, "LIGHTS 1", {}, - "Electricity", - "InteriorLights", + Constant::eResource::Electricity, + Constant::EndUse::InteriorLights, "RailroadCrossing", // EndUseSubKey "Building", "SPACE1-1", @@ -6146,8 +6146,8 @@ namespace OutputProcessor { std::vector> reportDataDictionary( {{"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, - {"2", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Run Period", "", "J"}, - {"51", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Run Period", "", "J"}, + {"2", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Zone Timestep", "", "J"}, + {"51", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Zone Timestep", "", "J"}, {"124", "0", "Sum", "System", "HVAC System", "Site", "Environmental Impact Fuel Oil No 2 CO2 Emissions Mass", "Run Period", "", "kg"}}); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); } From 28e753a352027149565db8edeb56b677a864f39e Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 18 Oct 2023 17:45:56 -0500 Subject: [PATCH 21/50] Unit test --- tst/EnergyPlus/unit/MixedAir.unit.cc | 137 +++++++++++++++++---------- 1 file changed, 88 insertions(+), 49 deletions(-) diff --git a/tst/EnergyPlus/unit/MixedAir.unit.cc b/tst/EnergyPlus/unit/MixedAir.unit.cc index 05673497785..9f5f4f5f824 100644 --- a/tst/EnergyPlus/unit/MixedAir.unit.cc +++ b/tst/EnergyPlus/unit/MixedAir.unit.cc @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -739,6 +740,40 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) " CO2AvailSchedule, !- Name", " , !- Schedule Type Limits Name", " 1.0; !- Hourly value", + "People,", + " West Zone People, !- Name", + " West Zone, !- Zone or ZoneList Name", + " OCCUPY-1, !- Number of People Schedule Name", + " people, !- Number of People Calculation Method", + " 11, !- Number of People", + " , !- People per Zone Floor Area {person/m2}", + " , !- Zone Floor Area per Person {m2/person}", + " 0.3, !- Fraction Radiant", + " , !- Sensible Heat Fraction", + " ActSchd; !- Activity Level Schedule Name", + "Schedule:Compact,", + " OCCUPY-1, !- Name", + " Fraction, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2", + " Until: 8:00, 0.0, !- Field 4", + " Until: 11:00, 1.00, !- Field 6", + " Until: 12:00, 0.80, !- Field 8", + " Until: 13:00, 0.40, !- Field 10", + " Until: 14:00, 0.80, !- Field 12", + " Until: 18:00, 1.00, !- Field 14", + " Until: 19:00, 0.50, !- Field 16", + " Until: 21:00, 0.10, !- Field 18", + " Until: 24:00, 0.0, !- Field 20", + " For: Weekends WinterDesignDay Holiday, !- Field 21", + " Until: 24:00, 0.0; !- Field 23", + "Schedule:Compact,", + " ActSchd, !- Name", + " Any Number, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00, 117.239997864;", + " !- Field 4", " Controller:OutdoorAir,", " OA Controller 1, !- Name", " Relief Air Outlet Node, !- Relief Air Outlet Node Name", @@ -776,10 +811,11 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) state->dataAirLoop->AirLoopControlInfo.allocate(1); state->dataAirLoop->AirLoopControlInfo(1).LoopFlowRateSet = true; state->dataSize->OARequirements.allocate(1); - state->dataSize->OARequirements(1).Name = "CM DSOA WEST ZONE"; - state->dataSize->OARequirements(1).OAFlowMethod = OAFlowCalcMethod::Sum; - state->dataSize->OARequirements(1).OAFlowPerPerson = 0.003149; - state->dataSize->OARequirements(1).OAFlowPerArea = 0.000407; + auto &oaRequirements = state->dataSize->OARequirements(1); + oaRequirements.Name = "CM DSOA WEST ZONE"; + oaRequirements.OAFlowMethod = OAFlowCalcMethod::Sum; + oaRequirements.OAFlowPerPerson = 0.003149; + oaRequirements.OAFlowPerArea = 0.000407; state->dataSize->ZoneAirDistribution.allocate(1); state->dataSize->ZoneAirDistribution(1).Name = "CM DSZAD WEST ZONE"; @@ -789,32 +825,37 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) state->dataHeatBal->Zone(1).Name = "WEST ZONE"; state->dataHeatBal->Zone(1).FloorArea = 10.0; state->dataHeatBal->Zone(1).ZoneContamControllerSchedIndex = 4; - + state->dataHeatBal->Zone(1).numSpaces = 1; + state->dataHeatBal->Zone(1).spaceIndexes.emplace_back(1); + state->dataGlobal->NumOfZones = 1; + state->dataHeatBal->space.allocate(1); + state->dataHeatBal->space(1).Name = "WEST ZONE"; + state->dataHeatBal->space(1).FloorArea = 10.0; + state->dataHeatBal->space(1).zoneNum = 1; + state->dataGlobal->numSpaces = 1; + DataHeatBalance::AllocateIntGains(*state); state->dataAirLoop->AirLoopFlow.allocate(1); state->dataAirLoop->AirLoopFlow(1).OAFrac = 0.01; // DataAirLoop variable (AirloopHVAC) state->dataAirLoop->AirLoopFlow(1).OAMinFrac = 0.01; // DataAirLoop variable (AirloopHVAC) + state->dataGlobal->NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized + state->dataGlobal->MinutesPerTimeStep = 15; // must initialize this to get schedules initialized + ScheduleManager::ProcessScheduleInput(*state); + InternalHeatGains::GetInternalHeatGainsInput(*state); GetOAControllerInputs(*state); - EXPECT_EQ(SysOAMethod::ProportionalControlDesOcc, state->dataMixedAir->VentilationMechanical(1).SystemOAMethod); - EXPECT_TRUE(OutAirNodeManager::CheckOutAirNodeNumber(*state, state->dataMixedAir->OAController(1).OANode)); - EXPECT_NEAR(0.00314899, state->dataMixedAir->VentilationMechanical(1).VentMechZone(1).ZoneOAPeopleRate, 0.00001); - EXPECT_NEAR(0.000407, state->dataMixedAir->VentilationMechanical(1).VentMechZone(1).ZoneOAAreaRate, 0.00001); + auto &oaController = state->dataMixedAir->OAController(1); + auto &ventMechanical = state->dataMixedAir->VentilationMechanical(1); + EXPECT_EQ(SysOAMethod::ProportionalControlDesOcc, ventMechanical.SystemOAMethod); + EXPECT_TRUE(OutAirNodeManager::CheckOutAirNodeNumber(*state, oaController.OANode)); + EXPECT_NEAR(0.00314899, ventMechanical.VentMechZone(1).ZoneOAPeopleRate, 0.00001); + EXPECT_NEAR(0.000407, ventMechanical.VentMechZone(1).ZoneOAAreaRate, 0.00001); - state->dataEnvrn->StdRhoAir = 1.2; - state->dataMixedAir->OAController(1).MixMassFlow = 1.7 * state->dataEnvrn->StdRhoAir; - state->dataMixedAir->OAController(1).MaxOAMassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; - state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7; - state->dataMixedAir->VentilationMechanical(1).SchPtr = 1; + ventMechanical.SchPtr = 1; state->dataScheduleMgr->Schedule(1).CurrentValue = 1.0; - state->dataMixedAir->VentilationMechanical(1).VentMechZone(1).ZoneADEffSchPtr = 2; + ventMechanical.VentMechZone(1).ZoneADEffSchPtr = 2; state->dataScheduleMgr->Schedule(2).CurrentValue = 1.0; - state->dataHeatBal->TotPeople = 1; - state->dataHeatBal->People.allocate(1); - state->dataHeatBal->People(1).Name = "WestPeople"; - state->dataHeatBal->People(1).ZonePtr = 1; - state->dataHeatBal->People(1).NumberOfPeople = 3; state->dataHeatBal->Zone(1).TotOccupants = 3; state->dataScheduleMgr->Schedule(4).CurrentValue = 1.0; state->dataContaminantBalance->ZoneCO2GainFromPeople.allocate(1); @@ -835,37 +876,34 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) state->dataEnvrn->OutBaroPress = 101325; state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1); - state->dataMixedAir->OAController(1).CalcOAController(*state, 1, true); - - EXPECT_NEAR(0.0194359, state->dataMixedAir->OAController(1).OAMassFlow, 0.00001); - EXPECT_NEAR(0.009527, state->dataMixedAir->OAController(1).MinOAFracLimit, 0.00001); - - state->dataSize->OARequirements(1).OAFlowMethod = OAFlowCalcMethod::PCDesOcc; - state->dataMixedAir->VentilationMechanical(1).VentMechZone(1).ZoneOAFlowMethod = state->dataSize->OARequirements(1).OAFlowMethod; + oaRequirements.OAFlowMethod = OAFlowCalcMethod::PCDesOcc; + ventMechanical.VentMechZone(1).ZoneOAFlowMethod = oaRequirements.OAFlowMethod; state->dataAirLoop->NumOASystems = 1; state->dataAirLoop->OutsideAirSys.allocate(1); - state->dataAirLoop->OutsideAirSys(1).Name = "AIRLOOP OASYSTEM"; - state->dataAirLoop->OutsideAirSys(1).NumControllers = 1; - state->dataAirLoop->OutsideAirSys(1).ControllerName.allocate(1); - state->dataAirLoop->OutsideAirSys(1).ControllerName(1) = "OA CONTROLLER 1"; - state->dataAirLoop->OutsideAirSys(1).ComponentType.allocate(1); - state->dataAirLoop->OutsideAirSys(1).ComponentType(1) = "OutdoorAir:Mixer"; - state->dataAirLoop->OutsideAirSys(1).ComponentName.allocate(1); - state->dataAirLoop->OutsideAirSys(1).ComponentName(1) = "OAMixer"; + auto &OASys = state->dataAirLoop->OutsideAirSys(1); + OASys.Name = "AIRLOOP OASYSTEM"; + OASys.NumControllers = 1; + OASys.ControllerName.allocate(1); + OASys.ControllerName(1) = "OA CONTROLLER 1"; + OASys.ComponentType.allocate(1); + OASys.ComponentType(1) = "OutdoorAir:Mixer"; + OASys.ComponentName.allocate(1); + OASys.ComponentName(1) = "OAMixer"; state->dataMixedAir->OAMixer.allocate(1); state->dataMixedAir->OAMixer(1).Name = "OAMixer"; state->dataMixedAir->OAMixer(1).InletNode = 2; state->dataHVACGlobal->NumPrimaryAirSys = 1; state->dataAirSystemsData->PrimaryAirSystems.allocate(1); - state->dataAirSystemsData->PrimaryAirSystems(1).Name = "PrimaryAirLoop"; - state->dataAirSystemsData->PrimaryAirSystems(1).NumBranches = 1; - state->dataAirSystemsData->PrimaryAirSystems(1).Branch.allocate(1); - state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).TotalComponents = 1; - state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(1); - state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).Name = state->dataAirLoop->OutsideAirSys(1).Name; - state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).TypeOf = "AirLoopHVAC:OutdoorAirSystem"; + auto &airSys = state->dataAirSystemsData->PrimaryAirSystems(1); + airSys.Name = "PrimaryAirLoop"; + airSys.NumBranches = 1; + airSys.Branch.allocate(1); + airSys.Branch(1).TotalComponents = 1; + airSys.Branch(1).Comp.allocate(1); + airSys.Branch(1).Comp(1).Name = state->dataAirLoop->OutsideAirSys(1).Name; + airSys.Branch(1).Comp(1).TypeOf = "AirLoopHVAC:OutdoorAirSystem"; state->dataAirLoop->AirLoopZoneInfo.allocate(1); state->dataAirLoop->AirLoopZoneInfo(1).NumZones = 1; @@ -874,14 +912,15 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) InitOAController(*state, 1, true, 1); EXPECT_EQ("ProportionalControlBasedOnDesignOccupancy", - DataSizing::OAFlowCalcMethodNames[static_cast(state->dataMixedAir->VentilationMechanical(1).VentMechZone(1).ZoneOAFlowMethod)]); + DataSizing::OAFlowCalcMethodNames[static_cast(ventMechanical.VentMechZone(1).ZoneOAFlowMethod)]); - state->dataAirLoop->OutsideAirSys.deallocate(); - state->dataMixedAir->OAMixer.deallocate(); - state->dataAirLoop->AirLoopZoneInfo.deallocate(); - state->dataAirSystemsData->PrimaryAirSystems.deallocate(); - state->dataContaminantBalance->ZoneAirCO2.deallocate(); - state->dataContaminantBalance->ZoneCO2GainFromPeople.deallocate(); + state->dataEnvrn->StdRhoAir = 1.2; + oaController.MixMassFlow = 1.7 * state->dataEnvrn->StdRhoAir; + oaController.MaxOAMassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; + state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7; + oaController.CalcOAController(*state, 1, true); + EXPECT_NEAR(0.0194644, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(0.009541, oaController.MinOAFracLimit, 0.00001); } TEST_F(EnergyPlusFixture, MissingDesignOccupancyTest) From 675b92a8e81be3b1e1857be8e190321ee40cc90b Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 20:27:25 -0500 Subject: [PATCH 22/50] Define a few enums to better fit the needs for the transitions. --- src/EnergyPlus/OutputProcessor.hh | 155 ++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index a609ece4adf..83875a9d59f 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -843,6 +843,161 @@ namespace OutputProcessor { // within the OutputProcessor. // ***************************************************************************** +enum class ReportFreqSOV +{ + EachCall = -1, // Write out each time UpdatedataandReport is called + Empty, + TimeStep, // Write out at 'EndTimeStepFlag' + Hourly, // Write out at 'EndHourFlag' + Daily, // Write out at 'EndDayFlag' + Monthly, // Write out at end of month (must be determined) + Simulation, // Write out once per environment 'EndEnvrnFlag' + Yearly, // Write out at 'EndYearFlag' + Num +}; +static constexpr std::array ReporFreqSOVNames = { + "", "TIMESTEP", "HOURLY", "DAILY", "MONTHLY", "SIMULATION", "YEARLY"}; + +enum class eResourceSOV +{ + Invalid = -1, + Empty, + Electricity, + NaturalGas, + Gasoline, + Diesel, + Coal, + Propane, + FuelOilNo1, + FuelOilNo2, + OtherFuel1, + OtherFuel2, + DistrictCooling, + DistrictHeatingWater, + DistrictHeatingSteam, + Water, + None, // used for OtherEquipment object + EnergyTransfer, + ElectricityProduced, + ElectricityPurchased, + ElectricitySurplusSold, + ElectricityNet, + SolarWater, + SolarAir, + CarbonEquivalent, + PlantLoopHeatingDemand, + PlantLoopCoolingDemand, + OnSiteWater, + MainsWater, + RainWater, + WellWater, + Condensate, + WaterEnvironmentalFactors, + Source, + Generic, // only used by custom meters + SO2, + NOx, + N2O, + PM, + PM2_5, + PM10, + CO, + CO2, + CH4, + NH3, + NMVOC, + Hg, + Pb, + NuclearHigh, + NuclearLow, + Num +}; +static constexpr std::array(eResourceSOV::Num)> eResourceSOVNames = {"", + "Electricity", + "NaturalGas", + "Gasoline", + "Diesel", + "Coal", + "Propane", + "FuelOilNo1", + "FuelOilNo2", + "OtherFuel1", + "OtherFuel2", + "DistrictCooling", + "DistrictHeatingWater", + "DistrictHeatingSteam", + "Water", + "None", + "EnergyTransfer", + "ElectricityProduced", + "ElectricityPurchased", + "ElectricitySurplusSold", + "ElectricityNet", + "SolarWater", + "SolarAir", + "Carbon Equivalent", + "PlantLoopHeatingDemand", + "PlantLoopCoolingDemand", + "OnSiteWater", + "MainsWater", + "RainWater", + "WellWater", + "Condensate", + "WaterEnvironmentalFactors", + "Source", + "Generic", + "SO2", + "NOx", + "N2O", + "PM", + "PM2.5", + "PM10", + "CO", + "CO2", + "CH4", + "NH3", + "NMVOC", + "Hg", + "Pb", + "Nuclear High", + "Nuclear Low"}; + +enum class EndUseCatSOV +{ + Invalid = -1, + Empty, + Heating, + Cooling, + InteriorLights, + ExteriorLights, + InteriorEquipment, + ExteriorEquipment, + Fans, + Pumps, + HeatRejection, + Humidification, + HeatRecovery, + WaterSystem, + Refrigeration, + Cogeneration, + Num +}; +static constexpr std::array endUseCatSOVNames = {"", + "HEATING", + "COOLING", + "INTERIORLIGHTS", + "EXTERIORLIGHTS", + "INTERIOREQUIPMENT", + "EXTERIOREQUIPMENT", + "FANS", + "PUMPS", + "HEATREJECTION", + "HUMIDIFIER", + "HEATRECOVERY", + "WATERSYSTEMS", + "REFRIGERATION", + "COGENERATION"}; + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable (with units) OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable From 6fecbf004b24d8407607862ade1b5b5b6550934f Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 20:51:26 -0500 Subject: [PATCH 23/50] Try a seemingly better implementation to resovle some issues. --- src/EnergyPlus/OutputProcessor.cc | 20 +++++++++--------- src/EnergyPlus/OutputProcessor.hh | 34 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 509bd0bafd6..efcead335d6 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4297,9 +4297,9 @@ void SetupOutputVariable(EnergyPlusData &state, OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string_view const KeyedValue, // Associated Key for this variable - OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency - Constant::eResource ResourceTypeKey, // Meter Resource Type (Electricity, Gas, etc) - Constant::EndUse EndUseKey, // Meter End Use Key (Lights, Heating, Cooling, etc) + ReportFreqSOV ReportFreq, // Internal use -- causes reporting at this freqency + eResourceSOV ResourceTypeKey, // Meter Resource Type (Electricity, Gas, etc) + EndUseCatSOV EndUseKey, // Meter End Use Key (Lights, Heating, Cooling, etc) std::string_view const EndUseSubKey, // Meter End Use Sub Key (General Lights, Task Lights, etc) std::string_view const GroupKey, // Meter Super Group Key (Building, System, Plant) std::string_view const ZoneKey, // Meter Zone Key (zone name) @@ -4313,21 +4313,21 @@ void SetupOutputVariable(EnergyPlusData &state, std::string locResourceTypeKey = ""; std::string locEndUseKey = ""; - if (ResourceTypeKey == Constant::eResource::Invalid) { + if (ResourceTypeKey == eResourceSOV::Invalid || ResourceTypeKey == eResourceSOV::Num) { // Fatal error warning message ShowFatalError(state, "Invalid Resource Type."); - } else if (ResourceTypeKey == Constant::eResource::Num) { + } else if (ResourceTypeKey == eResourceSOV::Empty) { locResourceTypeKey = ""; - } else if (EndUseKey == Constant::EndUse::Invalid) { + } else if (EndUseKey == EndUseCatSOV::Invalid || EndUseKey == EndUseCatSOV::Num) { // Fatal error warning message ShowFatalError(state, "Invalid End Use Category Type."); - } else if (EndUseKey == Constant::EndUse::Num) { + } else if (EndUseKey == EndUseCatSOV::Empty) { locEndUseKey = ""; } else { - locResourceTypeKey = Constant::eResourceNames[static_cast(ResourceTypeKey)]; // or eResourceNamesUC - locEndUseKey = OutputProcessor::endUseCategoryNames[static_cast(EndUseKey)]; + locResourceTypeKey = eResourceSOVNames[static_cast(ResourceTypeKey)]; // or eResourceNamesUC + locEndUseKey = endUseCatSOVNames[static_cast(EndUseKey)]; - if (ReportFreq == OutputProcessor::ReportingFrequency::EachCall) // This is valid + if (ReportFreq == ReportFreqSOV::EachCall) // This is valid { SetupOutputVariable(state, VariableName, diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 83875a9d59f..04b57cc3fe4 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -1008,23 +1008,23 @@ void SetupOutputVariable(EnergyPlusData &state, ); void SetupOutputVariable(EnergyPlusData &state, - std::string_view const VariableName, // String Name of variable (with units) - OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable - Real64 &ActualVariable, // Actual Variable, used to set up pointer - OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 - OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 - std::string_view const KeyedValue, // Associated Key for this variable - OutputProcessor::ReportingFrequency ReportFreq, // Internal use -- causes reporting at this freqency - Constant::eResource ResourceTypeKey = Constant::eResource::Num, // Meter Resource Type (Electricity, Gas, etc) - Constant::EndUse EndUseKey = Constant::EndUse::Num, // Meter End Use Key (Lights, Heating, Cooling, etc) - std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) - std::string_view const GroupKey = {}, // Meter Super Group Key (Building, System, Plant) - std::string_view const ZoneKey = {}, // Meter Zone Key (zone name) - int const ZoneMult = 1, // Zone Multiplier, defaults to 1 - int const ZoneListMult = 1, // Zone List Multiplier, defaults to 1 - int const indexGroupKey = -999, // Group identifier for SQL output - std::string_view const customUnitName = {}, // the custom name for the units from EMS definition of units - std::string_view const SpaceType = {} // Space type (applicable for Building group only) + std::string_view const VariableName, // String Name of variable (with units) + OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable + Real64 &ActualVariable, // Actual Variable, used to set up pointer + OutputProcessor::SOVTimeStepType TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + OutputProcessor::SOVStoreType VariableTypeKey, // State, Average=1, NonState, Sum=2 + std::string_view const KeyedValue, // Associated Key for this variable + ReportFreqSOV ReportFreq, // Internal use -- causes reporting at this freqency + eResourceSOV ResourceTypeKey = eResourceSOV::Empty, // Meter Resource Type (Electricity, Gas, etc) + EndUseCatSOV EndUseKey = EndUseCatSOV::Empty, // Meter End Use Key (Lights, Heating, Cooling, etc) + std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) + std::string_view const GroupKey = {}, // Meter Super Group Key (Building, System, Plant) + std::string_view const ZoneKey = {}, // Meter Zone Key (zone name) + int const ZoneMult = 1, // Zone Multiplier, defaults to 1 + int const ZoneListMult = 1, // Zone List Multiplier, defaults to 1 + int const indexGroupKey = -999, // Group identifier for SQL output + std::string_view const customUnitName = {}, // the custom name for the units from EMS definition of units + std::string_view const SpaceType = {} // Space type (applicable for Building group only) ); void SetupOutputVariable(EnergyPlusData &state, From 069fef7db2861fbfe50cd222986c82c76e7a6656 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 21:10:18 -0500 Subject: [PATCH 24/50] Fine details for updated implementations. --- src/EnergyPlus/OutputProcessor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index efcead335d6..97f63ca940c 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4355,7 +4355,7 @@ void SetupOutputVariable(EnergyPlusData &state, TimeStepTypeKey, VariableTypeKey, KeyedValue, - OutputProcessor::ReportingFrequencyNames[static_cast(ReportFreq)], + ReporFreqSOVNames[static_cast(ReportFreq)], locResourceTypeKey, locEndUseKey, EndUseSubKey, From 116f0e52d407563c0f81b28b26b2c7c6da978824 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Wed, 18 Oct 2023 21:10:32 -0500 Subject: [PATCH 25/50] Unit test update. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 3f469dd6e9e..2661c51e4fe 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6042,9 +6042,9 @@ namespace OutputProcessor { OutputProcessor::SOVTimeStepType::System, OutputProcessor::SOVStoreType::Summed, "Cool-1", - {}, // OutputProcessor::ReportingFrequency ReportFreq, - Constant::eResource::Electricity, - Constant::EndUse::Cooling, + {}, + eResourceSOV::Electricity, + EndUseCatSOV::Cooling, {}, // EndUseSubKey "Plant"); @@ -6057,8 +6057,8 @@ namespace OutputProcessor { OutputProcessor::SOVStoreType::Summed, "LIGHTS 1", {}, - Constant::eResource::Electricity, - Constant::EndUse::InteriorLights, + eResourceSOV::Electricity, + EndUseCatSOV::InteriorLights, "RailroadCrossing", // EndUseSubKey "Building", "SPACE1-1", @@ -6146,8 +6146,8 @@ namespace OutputProcessor { std::vector> reportDataDictionary( {{"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, - {"2", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Zone Timestep", "", "J"}, - {"51", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Zone Timestep", "", "J"}, + {"2", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Run Period", "", "J"}, + {"51", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Run Period", "", "J"}, {"124", "0", "Sum", "System", "HVAC System", "Site", "Environmental Impact Fuel Oil No 2 CO2 Emissions Mass", "Run Period", "", "kg"}}); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); } From ece5b916621d3950d98b9bbebd4c685703164f5a Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 07:33:46 -0500 Subject: [PATCH 26/50] Expand end use category entries which is needed for compatiability. --- src/EnergyPlus/OutputProcessor.hh | 104 +++++++++++++++++++++++++----- 1 file changed, 89 insertions(+), 15 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 04b57cc3fe4..a38ba36718c 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -980,23 +980,97 @@ enum class EndUseCatSOV WaterSystem, Refrigeration, Cogeneration, + Baseboard, + Boilers, + CarbonEquivalentEmissions, + Chillers, + CoalEmissions, + ColdStorageCharge, + ColdStorageDischarge, + Condensate, + CoolingCoils, + CoolingPanel, + DieselEmissions, + DistrictChilledWater, + DistrictHotWater, + ElectricityEmissions, + ElectricStorage, + Freecooling, + FuelOilNo1Emissions, + FuelOilNo2Emissions, + GasolineEmissions, + HeatingCoils, + HeatProduced, + HeatRecoveryForCooling, + HeatRecoveryForHeating, + LoopToLoop, + MainsWater, + NaturalGasEmissions, + OtherFuel1Emissions, + OtherFuel2Emissions, + Photovoltaic, + PowerConversion, + PropaneEmissions, + PurchasedElectricityEmissions, + Rainwater, + SoldElectricityEmissions, + Wellwater, + WindTurbine, Num }; -static constexpr std::array endUseCatSOVNames = {"", - "HEATING", - "COOLING", - "INTERIORLIGHTS", - "EXTERIORLIGHTS", - "INTERIOREQUIPMENT", - "EXTERIOREQUIPMENT", - "FANS", - "PUMPS", - "HEATREJECTION", - "HUMIDIFIER", - "HEATRECOVERY", - "WATERSYSTEMS", - "REFRIGERATION", - "COGENERATION"}; +static constexpr std::array endUseCatSOVNames = { + "", + "HEATING", + "COOLING", + "INTERIORLIGHTS", + "EXTERIORLIGHTS", + "INTERIOREQUIPMENT", + "EXTERIOREQUIPMENT", + "FANS", + "PUMPS", + "HEATREJECTION", + "HUMIDIFIER", + "HEATRECOVERY", + "WATERSYSTEMS", + "REFRIGERATION", + "COGENERATION" + "BASEBOARD", + "BOILERS", + "CARBONEQUIVALENTEMISSIONS", + "CHILLERS", + "COALEMISSIONS", + "COLDSTORAGECHARGE", + "COLDSTORAGEDISCHARGE", + "CONDENSATE", + "COOLINGCOILS", + "COOLINGPANEL", + "DIESELEMISSIONS", + "DISTRICTCHILLEDWATER", + "DISTRICTHOTWATER", + "ELECTRICITYEMISSIONS", + "ELECTRICSTORAGE", + "FREECOOLING", + "FUELOILNO1EMISSIONS", + "FUELOILNO2EMISSIONS", + "GASOLINEEMISSIONS", + "HEATINGCOILS", + "HEATPRODUCED", + "HEATRECOVERYFORCOOLING", + "HEATRECOVERYFORHEATING", + "LOOPTOLOOP", + "MAINSWATER", + "NATURALGASEMISSIONS", + "OTHERFUEL1EMISSIONS", + "OTHERFUEL2EMISSIONS", + "PHOTOVOLTAIC", + "POWERCONVERSION", + "PROPANEEMISSIONS", + "PURCHASEDELECTRICITYEMISSIONS", + "RAINWATER", + "SOLDELECTRICITYEMISSIONS", + "WELLWATER", + "WINDTURBINE", +}; void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable (with units) From 0b4266065ad325bd39c6bfa2fc8338e15543993f Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 07:54:57 -0500 Subject: [PATCH 27/50] Group types enums. --- src/EnergyPlus/OutputProcessor.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index a38ba36718c..f5e0a8127ba 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -1072,6 +1072,17 @@ static constexpr std::array endUseCatS "WINDTURBINE", }; +enum class GroupSOV +{ + Invalid = -1, + Empty, + Building, + HVAC, + Plant, + Num +}; +static constexpr std::array GroupSOVNames = {"", "Building", "HVAC", "Plant"}; + void SetupOutputVariable(EnergyPlusData &state, std::string_view const VariableName, // String Name of variable (with units) OutputProcessor::Unit VariableUnit, // Actual units corresponding to the actual variable From c70e546c21bf0fde1c00f25d47c8e99f9df83f04 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 08:14:48 -0500 Subject: [PATCH 28/50] Implement with group names and some modifications on logics. --- src/EnergyPlus/OutputProcessor.cc | 87 ++++++++++++++++--------------- src/EnergyPlus/OutputProcessor.hh | 2 +- 2 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 97f63ca940c..266c51525e3 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4301,7 +4301,7 @@ void SetupOutputVariable(EnergyPlusData &state, eResourceSOV ResourceTypeKey, // Meter Resource Type (Electricity, Gas, etc) EndUseCatSOV EndUseKey, // Meter End Use Key (Lights, Heating, Cooling, etc) std::string_view const EndUseSubKey, // Meter End Use Sub Key (General Lights, Task Lights, etc) - std::string_view const GroupKey, // Meter Super Group Key (Building, System, Plant) + GroupSOV GroupKey, // Meter Super Group Key (Building, System, Plant) std::string_view const ZoneKey, // Meter Zone Key (zone name) int const ZoneMult, // Zone Multiplier, defaults to 1 int const ZoneListMult, // Zone List Multiplier, defaults to 1 @@ -4310,64 +4310,65 @@ void SetupOutputVariable(EnergyPlusData &state, std::string_view const SpaceType // Space type (applicable for Building group only) ) { + std::string locReportFreq = ""; std::string locResourceTypeKey = ""; std::string locEndUseKey = ""; + std::string locGroupKey = ""; + + if (ReportFreq == ReportFreqSOV::Num) { + // Fatal error warning message + ShowFatalError(state, "Invalid Resource Type."); + } else if (ReportFreq == ReportFreqSOV::EachCall) // This is valid + { + locReportFreq = "DETAILED"; + } else { + locReportFreq = ReporFreqSOVNames[static_cast(ReportFreq)]; + } if (ResourceTypeKey == eResourceSOV::Invalid || ResourceTypeKey == eResourceSOV::Num) { // Fatal error warning message ShowFatalError(state, "Invalid Resource Type."); } else if (ResourceTypeKey == eResourceSOV::Empty) { locResourceTypeKey = ""; - } else if (EndUseKey == EndUseCatSOV::Invalid || EndUseKey == EndUseCatSOV::Num) { + } else { + locResourceTypeKey = eResourceSOVNames[static_cast(ResourceTypeKey)]; // or eResourceNamesUC + } + + if (EndUseKey == EndUseCatSOV::Invalid || EndUseKey == EndUseCatSOV::Num) { // Fatal error warning message ShowFatalError(state, "Invalid End Use Category Type."); } else if (EndUseKey == EndUseCatSOV::Empty) { locEndUseKey = ""; } else { - locResourceTypeKey = eResourceSOVNames[static_cast(ResourceTypeKey)]; // or eResourceNamesUC locEndUseKey = endUseCatSOVNames[static_cast(EndUseKey)]; + } - if (ReportFreq == ReportFreqSOV::EachCall) // This is valid - { - SetupOutputVariable(state, - VariableName, - VariableUnit, - ActualVariable, - TimeStepTypeKey, - VariableTypeKey, - KeyedValue, - "DETAILED", - locResourceTypeKey, - locEndUseKey, - EndUseSubKey, - GroupKey, - ZoneKey, - ZoneMult, - ZoneListMult, - indexGroupKey, - customUnitName, - SpaceType); - } else { - SetupOutputVariable(state, - VariableName, - VariableUnit, - ActualVariable, - TimeStepTypeKey, - VariableTypeKey, - KeyedValue, - ReporFreqSOVNames[static_cast(ReportFreq)], - locResourceTypeKey, - locEndUseKey, - EndUseSubKey, - GroupKey, - ZoneKey, - ZoneMult, - ZoneListMult, - indexGroupKey, - customUnitName, - SpaceType); - } + if (GroupKey == GroupSOV::Invalid || GroupKey == GroupSOV::Num) { + ShowFatalError(state, "Invalid Group Type."); + } else if (GroupKey == GroupSOV::Empty) { + locGroupKey = ""; + } else { + locGroupKey = GroupSOVNames[static_cast(GroupKey)]; } + + SetupOutputVariable(state, + VariableName, + VariableUnit, + ActualVariable, + TimeStepTypeKey, + VariableTypeKey, + KeyedValue, + locReportFreq, + locResourceTypeKey, + locEndUseKey, + EndUseSubKey, + locGroupKey, + ZoneKey, + ZoneMult, + ZoneListMult, + indexGroupKey, + customUnitName, + SpaceType); } // TODO: Probably move these to a different location diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index f5e0a8127ba..fa708616341 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -1103,7 +1103,7 @@ void SetupOutputVariable(EnergyPlusData &state, eResourceSOV ResourceTypeKey = eResourceSOV::Empty, // Meter Resource Type (Electricity, Gas, etc) EndUseCatSOV EndUseKey = EndUseCatSOV::Empty, // Meter End Use Key (Lights, Heating, Cooling, etc) std::string_view const EndUseSubKey = {}, // Meter End Use Sub Key (General Lights, Task Lights, etc) - std::string_view const GroupKey = {}, // Meter Super Group Key (Building, System, Plant) + GroupSOV GroupKey = GroupSOV::Empty, // Meter Super Group Key (Building, System, Plant) std::string_view const ZoneKey = {}, // Meter Zone Key (zone name) int const ZoneMult = 1, // Zone Multiplier, defaults to 1 int const ZoneListMult = 1, // Zone List Multiplier, defaults to 1 From 0387500fa2d4e90ef54572ce08d780b7d3b70f53 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 08:24:06 -0500 Subject: [PATCH 29/50] Unit test update with recent code changes. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 2661c51e4fe..4fa242dc1d1 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6046,7 +6046,7 @@ namespace OutputProcessor { eResourceSOV::Electricity, EndUseCatSOV::Cooling, {}, // EndUseSubKey - "Plant"); + GroupSOV::Plant); Real64 light_consumption = 0.; SetupOutputVariable(*state, @@ -6060,7 +6060,7 @@ namespace OutputProcessor { eResourceSOV::Electricity, EndUseCatSOV::InteriorLights, "RailroadCrossing", // EndUseSubKey - "Building", + GroupSOV::Building, "SPACE1-1", 1, 1); From e3810b3339cffaf000e2d02bc39e2e10a8b8b849 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 08:59:33 -0500 Subject: [PATCH 30/50] Unit test added more test output entries. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 4fa242dc1d1..7c79a3b02c6 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6020,6 +6020,8 @@ namespace OutputProcessor { "Output:Variable,*,Chiller Electricity Energy,runperiod;", "Output:Variable,*,Lights Electricity Energy,runperiod;", "Output:Variable,*,Environmental Impact Fuel Oil No 2 CO2 Emissions Mass,runperiod;", + "Output:Variable,*,Chiller Electricity Energy,hourly;", + "Output:Variable,*,Lights Electricity Energy,timestep;", }); ASSERT_TRUE(process_idf(idf_objects)); @@ -6147,11 +6149,12 @@ namespace OutputProcessor { std::vector> reportDataDictionary( {{"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, {"2", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Run Period", "", "J"}, - {"51", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Run Period", "", "J"}, - {"124", "0", "Sum", "System", "HVAC System", "Site", "Environmental Impact Fuel Oil No 2 CO2 Emissions Mass", "Run Period", "", "kg"}}); + {"51", "0", "Sum", "System", "HVAC System", "Cool-1", "Chiller Electricity Energy", "Hourly", "", "J"}, + {"52", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Run Period", "", "J"}, + {"125", "0", "Sum", "Zone", "Zone", "LIGHTS 1", "Lights Electricity Energy", "Zone Timestep", "", "J"}, + {"126", "0", "Sum", "System", "HVAC System", "Site", "Environmental Impact Fuel Oil No 2 CO2 Emissions Mass", "Run Period", "", "kg"}}); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); } - } // namespace OutputProcessor } // namespace EnergyPlus From 75d28cbdc18e759c649e92caaf4388b2a3ac8ce5 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 10:48:02 -0500 Subject: [PATCH 31/50] End use strings correction. --- src/EnergyPlus/OutputProcessor.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index fa708616341..ad459e5a0d1 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -1033,7 +1033,7 @@ static constexpr std::array endUseCatS "HEATRECOVERY", "WATERSYSTEMS", "REFRIGERATION", - "COGENERATION" + "COGENERATION", "BASEBOARD", "BOILERS", "CARBONEQUIVALENTEMISSIONS", From ba1f702f592270032d45c834bbc21fe5bcf17099 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 10:51:35 -0500 Subject: [PATCH 32/50] Unit test revisions. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 7c79a3b02c6..b882afa8b85 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6076,10 +6076,10 @@ namespace OutputProcessor { OutputProcessor::SOVStoreType::Summed, "Site", {}, - "CO2", - "FuelOilNo2Emissions", + eResourceSOV::CO2, + EndUseCatSOV::FuelOilNo2Emissions, {}, // EndUseSubKey - ""); + GroupSOV::Empty); auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); From a58cf056a37e8a1d7bbf98b4fc70a9131ed99860 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 11:08:49 -0500 Subject: [PATCH 33/50] Simplifcations at a few places. --- src/EnergyPlus/OutputProcessor.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 266c51525e3..6d06f5862fc 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -4328,25 +4328,19 @@ void SetupOutputVariable(EnergyPlusData &state, if (ResourceTypeKey == eResourceSOV::Invalid || ResourceTypeKey == eResourceSOV::Num) { // Fatal error warning message ShowFatalError(state, "Invalid Resource Type."); - } else if (ResourceTypeKey == eResourceSOV::Empty) { - locResourceTypeKey = ""; } else { - locResourceTypeKey = eResourceSOVNames[static_cast(ResourceTypeKey)]; // or eResourceNamesUC + locResourceTypeKey = eResourceSOVNames[static_cast(ResourceTypeKey)]; } if (EndUseKey == EndUseCatSOV::Invalid || EndUseKey == EndUseCatSOV::Num) { // Fatal error warning message - ShowFatalError(state, "Invalid End Use Category Type."); - } else if (EndUseKey == EndUseCatSOV::Empty) { - locEndUseKey = ""; + ShowFatalError(state, "Invalid End Use Category."); } else { locEndUseKey = endUseCatSOVNames[static_cast(EndUseKey)]; } if (GroupKey == GroupSOV::Invalid || GroupKey == GroupSOV::Num) { ShowFatalError(state, "Invalid Group Type."); - } else if (GroupKey == GroupSOV::Empty) { - locGroupKey = ""; } else { locGroupKey = GroupSOVNames[static_cast(GroupKey)]; } From d398012576e281736fee225e6101455accf3466e Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 11:25:44 -0500 Subject: [PATCH 34/50] Unit test notes. --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index b882afa8b85..37c6363d555 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6014,7 +6014,12 @@ namespace OutputProcessor { TEST_F(SQLiteFixture, OutputProcessor_SetupOutputVariable_enum) { - // Test SOV calls for PR 10231 + // Test SOV calls for PR 10231 for extended tests on Calling SOV using new enum parameter drivers, upon different varieties such as: + // 1). SOV calls for average, summed variables (regular and meters etc.) + // 2). SOV handling on Output:variable processed results + // 3). Wild cards + // 4). Report frequencies; + // 5). Emissions categories; std::string const idf_objects = delimited_string({ "Output:Variable,*,Site Outdoor Air Drybulb Temperature,runperiod;", "Output:Variable,*,Chiller Electricity Energy,runperiod;", From 8894d6b7266b78bc91d9e418ff6236ef0dd2a0db Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 11:40:31 -0500 Subject: [PATCH 35/50] Exmaple 1 on transitioning BaseboardElectric. --- src/EnergyPlus/BaseboardElectric.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index af04ae276e2..871fd33cd0a 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -352,10 +352,10 @@ namespace BaseboardElectric { OutputProcessor::SOVStoreType::Summed, thisBaseboard.EquipName, {}, - "ENERGYTRANSFER", - "BASEBOARD", + eResourceSOV::EnergyTransfer, + EndUseCatSOV::Baseboard, {}, - "System"); + GroupSOV::HVAC); // "System"); SetupOutputVariable(state, "Baseboard Total Heating Rate", @@ -373,10 +373,10 @@ namespace BaseboardElectric { OutputProcessor::SOVStoreType::Summed, thisBaseboard.EquipName, {}, - "Electricity", - "HEATING", + eResourceSOV::Electricity, + EndUseCatSOV::Heating, {}, - "System"); + GroupSOV::HVAC); // "System"); SetupOutputVariable(state, "Baseboard Electricity Rate", From 845cbdd3365b9caa9f50f3c828ea22e6c249e701 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 11:41:29 -0500 Subject: [PATCH 36/50] Example 2 on transitioning CoolingTower. --- src/EnergyPlus/CoolTower.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index efe6a09bb9a..eb4a77b5aca 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -540,10 +540,10 @@ namespace CoolTower { OutputProcessor::SOVStoreType::Summed, Zone(state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr).Name, {}, - "Electricity", - "Cooling", + eResourceSOV::Electricity, + EndUseCatSOV::Cooling, {}, - "System"); + GroupSOV::HVAC); //"System"); if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupplyMode == WaterSupplyMode::FromMains) { SetupOutputVariable(state, "Zone Cooltower Water Volume", @@ -560,10 +560,10 @@ namespace CoolTower { OutputProcessor::SOVStoreType::Summed, Zone(state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr).Name, {}, - "MainsWater", - "Cooling", + eResourceSOV::MainsWater, + EndUseCatSOV::Cooling, {}, - "System"); + GroupSOV::HVAC); // "System"); } else if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupplyMode == WaterSupplyMode::FromTank) { SetupOutputVariable(state, "Zone Cooltower Water Volume", @@ -587,10 +587,10 @@ namespace CoolTower { OutputProcessor::SOVStoreType::Summed, Zone(state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr).Name, {}, - "MainsWater", - "Cooling", + eResourceSOV::MainsWater, + EndUseCatSOV::Cooling, {}, - "System"); + GroupSOV::HVAC); // "System"); } } } From 76329199fbd17c1703c8668e3d6066b31af58f09 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 11:41:58 -0500 Subject: [PATCH 37/50] Example 3 on transitioning EarthTube. --- src/EnergyPlus/EarthTube.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index bc000b42e08..fbedb038b4e 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -554,10 +554,10 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i OutputProcessor::SOVStoreType::NonState, zone.Name, {}, - "Electricity", + eResourceSOV::Electricity, {}, {}, - "Building"); + GroupSOV::Building); SetupOutputVariable(state, "Earth Tube Fan Electricity Rate", OutputProcessor::Unit::W, From 7c97257d0c9614fb191c9084dab4380a7d01a5d1 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 12:58:03 -0500 Subject: [PATCH 38/50] Example 4 on transitioning BaseboardRadiator. --- src/EnergyPlus/BaseboardRadiator.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 1590070af5f..56044c5f127 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -438,10 +438,10 @@ namespace BaseboardRadiator { OutputProcessor::SOVStoreType::Summed, thisBaseboard.EquipID, {}, - "ENERGYTRANSFER", - "BASEBOARD", + eResourceSOV::EnergyTransfer, + EndUseCatSOV::Baseboard, {}, - "System"); + GroupSOV::HVAC); // "System"); SetupOutputVariable(state, "Baseboard Hot Water Energy", @@ -451,10 +451,10 @@ namespace BaseboardRadiator { OutputProcessor::SOVStoreType::Summed, thisBaseboard.EquipID, {}, - "PLANTLOOPHEATINGDEMAND", - "BASEBOARD", + eResourceSOV::PlantLoopHeatingDemand, + EndUseCatSOV::Baseboard, {}, - "System"); + GroupSOV::HVAC); // "System"); SetupOutputVariable(state, "Baseboard Total Heating Rate", From 6a95b5dcd7672e968298ee6db4f1049205d46c43 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Thu, 19 Oct 2023 13:02:12 -0500 Subject: [PATCH 39/50] Exmaple 5a on transitioning Boilers. --- src/EnergyPlus/Boilers.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index c1cc2d27b06..91dc27ffa02 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -383,10 +383,10 @@ void BoilerSpecs::SetupOutputVars(EnergyPlusData &state) OutputProcessor::SOVStoreType::Summed, this->Name, {}, - "ENERGYTRANSFER", - "BOILERS", + eResourceSOV::EnergyTransfer, + EndUseCatSOV::Boilers, {}, - "Plant"); + GroupSOV::Plant); SetupOutputVariable(state, format("Boiler {} Rate", sFuelType), OutputProcessor::Unit::W, @@ -442,10 +442,10 @@ void BoilerSpecs::SetupOutputVars(EnergyPlusData &state) OutputProcessor::SOVStoreType::Summed, this->Name, {}, - "ELECTRICITY", - "Heating", + eResourceSOV::Electricity, + EndUseCatSOV::Heating, "Boiler Parasitic", - "Plant"); + GroupSOV::Plant); if (this->FuelType != Constant::eFuel::Electricity) { SetupOutputVariable(state, format("Boiler Ancillary {} Rate", sFuelType), From c47134d7dddffe50879c6df0dbbfff3a9c58867a Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 19 Oct 2023 13:46:13 -0500 Subject: [PATCH 40/50] More unit test --- tst/EnergyPlus/unit/MixedAir.unit.cc | 350 ++++++++++++++++++++++++++- 1 file changed, 347 insertions(+), 3 deletions(-) diff --git a/tst/EnergyPlus/unit/MixedAir.unit.cc b/tst/EnergyPlus/unit/MixedAir.unit.cc index 9f5f4f5f824..9c7a58c5aaa 100644 --- a/tst/EnergyPlus/unit/MixedAir.unit.cc +++ b/tst/EnergyPlus/unit/MixedAir.unit.cc @@ -917,10 +917,354 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) state->dataEnvrn->StdRhoAir = 1.2; oaController.MixMassFlow = 1.7 * state->dataEnvrn->StdRhoAir; oaController.MaxOAMassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; - state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7; + state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7 * state->dataEnvrn->StdRhoAir; + + // From peeking inside the CO2 limit calcs + Real64 zoneCO2Max = 431.08678; + Real64 zoneCO2Min = 400.0; + + // Case 1 - Zone CO2 greater than CO2 Max, so OA flow is flow/area+flow/person + state->dataContaminantBalance->ZoneAirCO2(1) = 600.0; + Real64 expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * + state->dataEnvrn->StdRhoAir; + oaController.CalcOAController(*state, 1, true); + EXPECT_NEAR(expectedOAMassFlow, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); + + // Case 2 - Zone CO2 greater than CO2 Min, so OA flow is flow/area + state->dataContaminantBalance->ZoneAirCO2(1) = 200.0; + expectedOAMassFlow = oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea * state->dataEnvrn->StdRhoAir; + oaController.CalcOAController(*state, 1, true); + EXPECT_NEAR(expectedOAMassFlow, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); + + // Case 3 - Zone CO2 in between CO2 Max and Min, so OA flow is flow/area + proportionate flow/person + state->dataContaminantBalance->ZoneAirCO2(1) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); + expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + 0.3 * oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * + state->dataEnvrn->StdRhoAir; + oaController.CalcOAController(*state, 1, true); + EXPECT_NEAR(expectedOAMassFlow, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); +} + +TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) +{ + state->dataContaminantBalance->Contaminant.CO2Simulation = true; + state->dataContaminantBalance->Contaminant.CO2OutdoorSchedPtr = 1; + + std::string const idf_objects = delimited_string({ + " OutdoorAir:Node,", + " Outside Air Inlet Node; !- Name", + " Schedule:Constant,", + " VentSchedule, !- Name", + " , !- Schedule Type Limits Name", + " 1; !- Hourly value", + " Schedule:Constant,", + " ZoneADEffSch, !- Name", + " , !- Schedule Type Limits Name", + " 1; !- Hourly value", + " Schedule:Constant,", + " OAFractionSched, !- Name", + " , !- Schedule Type Limits Name", + " 1; !- Hourly value", + " Schedule:Constant,", + " CO2AvailSchedule, !- Name", + " , !- Schedule Type Limits Name", + " 1.0; !- Hourly value", + "People,", + " West Zone People, !- Name", + " West Zone, !- Zone or ZoneList Name", + " OCCUPY-1, !- Number of People Schedule Name", + " people, !- Number of People Calculation Method", + " 11, !- Number of People", + " , !- People per Zone Floor Area {person/m2}", + " , !- Zone Floor Area per Person {m2/person}", + " 0.3, !- Fraction Radiant", + " , !- Sensible Heat Fraction", + " ActSchd; !- Activity Level Schedule Name", + "People,", + " North Zone People, !- Name", + " North Zone, !- Zone or ZoneList Name", + " OCCUPY-1, !- Number of People Schedule Name", + " people, !- Number of People Calculation Method", + " 11, !- Number of People", + " , !- People per Zone Floor Area {person/m2}", + " , !- Zone Floor Area per Person {m2/person}", + " 0.3, !- Fraction Radiant", + " , !- Sensible Heat Fraction", + " ActSchd; !- Activity Level Schedule Name", + "People,", + " East Zone People, !- Name", + " East Zone, !- Zone or ZoneList Name", + " OCCUPY-1, !- Number of People Schedule Name", + " people, !- Number of People Calculation Method", + " 11, !- Number of People", + " , !- People per Zone Floor Area {person/m2}", + " , !- Zone Floor Area per Person {m2/person}", + " 0.3, !- Fraction Radiant", + " , !- Sensible Heat Fraction", + " ActSchd; !- Activity Level Schedule Name", + "Schedule:Compact,", + " OCCUPY-1, !- Name", + " Fraction, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2", + " Until: 8:00, 0.0, !- Field 4", + " Until: 11:00, 1.00, !- Field 6", + " Until: 12:00, 0.80, !- Field 8", + " Until: 13:00, 0.40, !- Field 10", + " Until: 14:00, 0.80, !- Field 12", + " Until: 18:00, 1.00, !- Field 14", + " Until: 19:00, 0.50, !- Field 16", + " Until: 21:00, 0.10, !- Field 18", + " Until: 24:00, 0.0, !- Field 20", + " For: Weekends WinterDesignDay Holiday, !- Field 21", + " Until: 24:00, 0.0; !- Field 23", + "Schedule:Compact,", + " ActSchd, !- Name", + " Any Number, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00, 117.239997864;", + " !- Field 4", + " Controller:OutdoorAir,", + " OA Controller 1, !- Name", + " Relief Air Outlet Node, !- Relief Air Outlet Node Name", + " Outdoor Air Mixer Inlet Node, !- Return Air Node Name", + " Mixed Air Node, !- Mixed Air Node Name", + " Outside Air Inlet Node, !- Actuator Node Name", + " 0.0, !- Minimum Outdoor Air Flow Rate{ m3 / s }", + " 1.7, !- Maximum Outdoor Air Flow Rate{ m3 / s }", + " NoEconomizer, !- Economizer Control Type", + " ModulateFlow, !- Economizer Control Action Type", + " , !- Economizer Maximum Limit Dry - Bulb Temperature{ C }", + " , !- Economizer Maximum Limit Enthalpy{ J / kg }", + " , !- Economizer Maximum Limit Dewpoint Temperature{ C }", + " , !- Electronic Enthalpy Limit Curve Name", + " , !- Economizer Minimum Limit Dry - Bulb Temperature{ C }", + " NoLockout, !- Lockout Type", + " FixedMinimum, !- Minimum Limit Type", + " OAFractionSched, !- Minimum Outdoor Air Schedule Name", + " , !- Minimum Fraction of Outdoor Air Schedule Name", + " , !- Maximum Fraction of Outdoor Air Schedule Name", + " DCVObject; !- Mechanical Ventilation Controller Name", + " Controller:MechanicalVentilation,", + " DCVObject, !- Name", + " VentSchedule, !- Availability Schedule Name", + " Yes, !- Demand Controlled Ventilation", + " ProportionalControlBasedonDesignOccupancy, !- System Outdoor Air Method", + " , !- Zone Maximum Outdoor Air Fraction{ dimensionless }", + " West Zone, !- Zone 1 Name", + " CM DSOA West Zone, !- Design Specification Outdoor Air Object Name 1", + " CM DSZAD West Zone, !- Design Specification Zone Air Distribution Object Name 1", + " North Zone, !- Zone 2 Name", + " CM DSOA West Zone, !- Design Specification Outdoor Air Object Name 1", + " CM DSZAD West Zone, !- Design Specification Zone Air Distribution Object Name 1", + " East Zone, !- Zone 3 Name", + " CM DSOA West Zone, !- Design Specification Outdoor Air Object Name 1", + " CM DSZAD West Zone; !- Design Specification Zone Air Distribution Object Name 1", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataAirLoop->AirLoopControlInfo.allocate(1); + state->dataAirLoop->AirLoopControlInfo(1).LoopFlowRateSet = true; + state->dataSize->OARequirements.allocate(1); + auto &oaRequirements = state->dataSize->OARequirements(1); + oaRequirements.Name = "CM DSOA WEST ZONE"; + oaRequirements.OAFlowMethod = OAFlowCalcMethod::Sum; + oaRequirements.OAFlowPerPerson = 0.003149; + oaRequirements.OAFlowPerArea = 0.000407; + + state->dataSize->ZoneAirDistribution.allocate(1); + state->dataSize->ZoneAirDistribution(1).Name = "CM DSZAD WEST ZONE"; + state->dataSize->ZoneAirDistribution(1).ZoneADEffSchPtr = 4; + + state->dataHeatBal->Zone.allocate(3); + state->dataHeatBal->Zone(1).Name = "WEST ZONE"; + state->dataHeatBal->Zone(1).FloorArea = 10.0; + state->dataHeatBal->Zone(1).ZoneContamControllerSchedIndex = 4; + state->dataHeatBal->Zone(1).numSpaces = 1; + state->dataHeatBal->Zone(1).spaceIndexes.emplace_back(1); + state->dataHeatBal->Zone(2).Name = "NORTH ZONE"; + state->dataHeatBal->Zone(2).FloorArea = 10.0; + state->dataHeatBal->Zone(2).ZoneContamControllerSchedIndex = 4; + state->dataHeatBal->Zone(2).numSpaces = 1; + state->dataHeatBal->Zone(2).spaceIndexes.emplace_back(2); + state->dataHeatBal->Zone(3).Name = "EAST ZONE"; + state->dataHeatBal->Zone(3).FloorArea = 10.0; + state->dataHeatBal->Zone(3).ZoneContamControllerSchedIndex = 4; + state->dataHeatBal->Zone(3).numSpaces = 1; + state->dataHeatBal->Zone(3).spaceIndexes.emplace_back(3); + state->dataGlobal->NumOfZones = 3; + state->dataHeatBal->space.allocate(3); + state->dataHeatBal->space(1).Name = "WEST ZONE"; + state->dataHeatBal->space(1).FloorArea = 10.0; + state->dataHeatBal->space(1).zoneNum = 1; + state->dataHeatBal->space(2).Name = "NORTH ZONE"; + state->dataHeatBal->space(2).FloorArea = 10.0; + state->dataHeatBal->space(2).zoneNum = 2; + state->dataHeatBal->space(3).Name = "EAST ZONE"; + state->dataHeatBal->space(3).FloorArea = 10.0; + state->dataHeatBal->space(3).zoneNum = 3; + state->dataGlobal->numSpaces = 3; + DataHeatBalance::AllocateIntGains(*state); + state->dataAirLoop->AirLoopFlow.allocate(1); + state->dataAirLoop->AirLoopFlow(1).OAFrac = 0.01; // DataAirLoop variable (AirloopHVAC) + state->dataAirLoop->AirLoopFlow(1).OAMinFrac = 0.01; // DataAirLoop variable (AirloopHVAC) + + state->dataGlobal->NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized + state->dataGlobal->MinutesPerTimeStep = 15; // must initialize this to get schedules initialized + ScheduleManager::ProcessScheduleInput(*state); + InternalHeatGains::GetInternalHeatGainsInput(*state); + GetOAControllerInputs(*state); + + auto &oaController = state->dataMixedAir->OAController(1); + auto &ventMechanical = state->dataMixedAir->VentilationMechanical(1); + EXPECT_EQ(SysOAMethod::ProportionalControlDesOcc, ventMechanical.SystemOAMethod); + EXPECT_TRUE(OutAirNodeManager::CheckOutAirNodeNumber(*state, oaController.OANode)); + EXPECT_NEAR(0.00314899, ventMechanical.VentMechZone(1).ZoneOAPeopleRate, 0.00001); + EXPECT_NEAR(0.000407, ventMechanical.VentMechZone(1).ZoneOAAreaRate, 0.00001); + EXPECT_NEAR(0.00314899, ventMechanical.VentMechZone(2).ZoneOAPeopleRate, 0.00001); + EXPECT_NEAR(0.000407, ventMechanical.VentMechZone(2).ZoneOAAreaRate, 0.00001); + EXPECT_NEAR(0.00314899, ventMechanical.VentMechZone(3).ZoneOAPeopleRate, 0.00001); + EXPECT_NEAR(0.000407, ventMechanical.VentMechZone(3).ZoneOAAreaRate, 0.00001); + + ventMechanical.SchPtr = 1; + state->dataScheduleMgr->Schedule(1).CurrentValue = 1.0; + + ventMechanical.VentMechZone(1).ZoneADEffSchPtr = 2; + ventMechanical.VentMechZone(2).ZoneADEffSchPtr = 2; + ventMechanical.VentMechZone(3).ZoneADEffSchPtr = 2; + state->dataScheduleMgr->Schedule(2).CurrentValue = 1.0; + state->dataHeatBal->Zone(1).TotOccupants = 3; + state->dataHeatBal->Zone(2).TotOccupants = 3; + state->dataHeatBal->Zone(3).TotOccupants = 3; + state->dataScheduleMgr->Schedule(4).CurrentValue = 1.0; + state->dataContaminantBalance->ZoneCO2GainFromPeople.allocate(3); + state->dataContaminantBalance->ZoneCO2GainFromPeople(1) = 3.82E-8; + state->dataContaminantBalance->ZoneCO2GainFromPeople(2) = 3.82E-8; + state->dataContaminantBalance->ZoneCO2GainFromPeople(3) = 3.82E-8; + state->dataContaminantBalance->OutdoorCO2 = 400; + state->dataContaminantBalance->ZoneAirCO2.allocate(3); + state->dataContaminantBalance->ZoneAirCO2(1) = 600.0; + state->dataContaminantBalance->ZoneAirCO2(2) = 600.0; + state->dataContaminantBalance->ZoneAirCO2(3) = 600.0; + state->dataZoneEquip->ZoneEquipConfig.allocate(3); + state->dataZoneEquip->ZoneEquipConfig(1).NumInletNodes = 1; + state->dataZoneEquip->ZoneEquipConfig(1).AirDistUnitCool.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(1).AirDistUnitCool(1).InNode = 10; + state->dataZoneEquip->ZoneEquipConfig(1).InletNode.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(1).InletNode(1) = 10; + state->dataZoneEquip->ZoneEquipConfig(2).NumInletNodes = 1; + state->dataZoneEquip->ZoneEquipConfig(2).AirDistUnitCool.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(2).AirDistUnitCool(1).InNode = 11; + state->dataZoneEquip->ZoneEquipConfig(2).InletNode.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(2).InletNode(1) = 11; + state->dataZoneEquip->ZoneEquipConfig(3).NumInletNodes = 1; + state->dataZoneEquip->ZoneEquipConfig(3).AirDistUnitCool.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(3).AirDistUnitCool(1).InNode = 12; + state->dataZoneEquip->ZoneEquipConfig(3).InletNode.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(3).InletNode(1) = 12; + state->dataLoopNodes->Node.allocate(12); + state->dataLoopNodes->Node(10).Temp = 13.00; + state->dataLoopNodes->Node(10).HumRat = 0.008; + state->dataLoopNodes->Node(10).MassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; + state->dataLoopNodes->Node(11) = state->dataLoopNodes->Node(10); + state->dataLoopNodes->Node(12) = state->dataLoopNodes->Node(10); + state->dataEnvrn->OutBaroPress = 101325; + state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(3); + + oaRequirements.OAFlowMethod = OAFlowCalcMethod::PCDesOcc; + ventMechanical.VentMechZone(1).ZoneOAFlowMethod = oaRequirements.OAFlowMethod; + ventMechanical.VentMechZone(2).ZoneOAFlowMethod = oaRequirements.OAFlowMethod; + ventMechanical.VentMechZone(3).ZoneOAFlowMethod = oaRequirements.OAFlowMethod; + state->dataAirLoop->NumOASystems = 1; + + state->dataAirLoop->OutsideAirSys.allocate(1); + auto &OASys = state->dataAirLoop->OutsideAirSys(1); + OASys.Name = "AIRLOOP OASYSTEM"; + OASys.NumControllers = 1; + OASys.ControllerName.allocate(1); + OASys.ControllerName(1) = "OA CONTROLLER 1"; + OASys.ComponentType.allocate(1); + OASys.ComponentType(1) = "OutdoorAir:Mixer"; + OASys.ComponentName.allocate(1); + OASys.ComponentName(1) = "OAMixer"; + state->dataMixedAir->OAMixer.allocate(1); + state->dataMixedAir->OAMixer(1).Name = "OAMixer"; + state->dataMixedAir->OAMixer(1).InletNode = 2; + + state->dataHVACGlobal->NumPrimaryAirSys = 1; + state->dataAirSystemsData->PrimaryAirSystems.allocate(1); + auto &airSys = state->dataAirSystemsData->PrimaryAirSystems(1); + airSys.Name = "PrimaryAirLoop"; + airSys.NumBranches = 1; + airSys.Branch.allocate(1); + airSys.Branch(1).TotalComponents = 1; + airSys.Branch(1).Comp.allocate(1); + airSys.Branch(1).Comp(1).Name = state->dataAirLoop->OutsideAirSys(1).Name; + airSys.Branch(1).Comp(1).TypeOf = "AirLoopHVAC:OutdoorAirSystem"; + + state->dataAirLoop->AirLoopZoneInfo.allocate(1); + state->dataAirLoop->AirLoopZoneInfo(1).NumZones = 3; + state->dataAirLoop->AirLoopZoneInfo(1).ActualZoneNumber.allocate(3); + state->dataAirLoop->AirLoopZoneInfo(1).ActualZoneNumber(1) = 1; + state->dataAirLoop->AirLoopZoneInfo(1).ActualZoneNumber(2) = 2; + state->dataAirLoop->AirLoopZoneInfo(1).ActualZoneNumber(3) = 3; + + InitOAController(*state, 1, true, 1); + EXPECT_EQ("ProportionalControlBasedOnDesignOccupancy", + DataSizing::OAFlowCalcMethodNames[static_cast(ventMechanical.VentMechZone(1).ZoneOAFlowMethod)]); + EXPECT_EQ("ProportionalControlBasedOnDesignOccupancy", + DataSizing::OAFlowCalcMethodNames[static_cast(ventMechanical.VentMechZone(2).ZoneOAFlowMethod)]); + EXPECT_EQ("ProportionalControlBasedOnDesignOccupancy", + DataSizing::OAFlowCalcMethodNames[static_cast(ventMechanical.VentMechZone(3).ZoneOAFlowMethod)]); + + state->dataEnvrn->StdRhoAir = 1.2; + oaController.MixMassFlow = 1.7 * state->dataEnvrn->StdRhoAir; + oaController.MaxOAMassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; + state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7 * state->dataEnvrn->StdRhoAir; + + // From peeking inside the CO2 limit calcs + Real64 zoneCO2Max = 431.08678; + Real64 zoneCO2Min = 400.0; + + // Case 1 - Zone CO2 greater than CO2 Max, so OA flow is flow/area+flow/person + state->dataContaminantBalance->ZoneAirCO2(1) = 600.0; + state->dataContaminantBalance->ZoneAirCO2(2) = 600.0; + state->dataContaminantBalance->ZoneAirCO2(3) = 600.0; + Real64 expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * + state->dataEnvrn->StdRhoAir; + oaController.CalcOAController(*state, 1, true); + // 3 identical zones should produce 3x OA flow + EXPECT_NEAR(3 * expectedOAMassFlow, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(3 * expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); + + // Case 2 - Zone CO2 less than CO2 Min, so OA flow is flow/area + state->dataContaminantBalance->ZoneAirCO2(1) = 200.0; + state->dataContaminantBalance->ZoneAirCO2(2) = 200.0; + state->dataContaminantBalance->ZoneAirCO2(3) = 200.0; + expectedOAMassFlow = oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea * state->dataEnvrn->StdRhoAir; + oaController.CalcOAController(*state, 1, true); + // 3 identical zones should produce 3x OA flow + EXPECT_NEAR(3 * expectedOAMassFlow, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(3 * expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); + + // Case 3 - Zone CO2 in between CO2 Max and Min, so OA flow is flow/area + proportionate flow/person + state->dataContaminantBalance->ZoneAirCO2(1) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); + state->dataContaminantBalance->ZoneAirCO2(2) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); + state->dataContaminantBalance->ZoneAirCO2(3) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); + expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + 0.3 * oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * + state->dataEnvrn->StdRhoAir; oaController.CalcOAController(*state, 1, true); - EXPECT_NEAR(0.0194644, oaController.OAMassFlow, 0.00001); - EXPECT_NEAR(0.009541, oaController.MinOAFracLimit, 0.00001); + // 3 identical zones should produce 3x OA flow + EXPECT_NEAR(3 * expectedOAMassFlow, oaController.OAMassFlow, 0.00001); + EXPECT_NEAR(3 * expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); } TEST_F(EnergyPlusFixture, MissingDesignOccupancyTest) From a0cae8d5bd8d46cf39c6a77b45279833893351f8 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Mon, 30 Oct 2023 11:07:42 -0500 Subject: [PATCH 41/50] Revert "Deal with EMS calling scenario." This reverts commit 7412ea9d5110acb764204738918baf03569879ff. --- src/EnergyPlus/RuntimeLanguageProcessor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index aa4eed02f76..a1786069fd3 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -3517,7 +3517,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) FreqString, VarTypeString, "EMS", - "", + {}, {}, {}, {}, From 3565ba3843f1062667828e68c693e08dd3ffa063 Mon Sep 17 00:00:00 2001 From: jcyuan Date: Mon, 30 Oct 2023 11:10:38 -0500 Subject: [PATCH 42/50] Revert "Fix calls from Python Plugin variable setups." This reverts commit a10e46965b827370f07f44426f3b5d863f72c5fe. --- src/EnergyPlus/PluginManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 8701723cf61..7389ba6a34a 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -201,7 +201,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) sUpdateFreq, sAvgOrSum, thisObjectName, - "", + {}, {}, {}, {}, From 557ac55a110da1f1fdb8db59273b005cf33de343 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 30 Oct 2023 14:24:48 -0500 Subject: [PATCH 43/50] Fix Namespace change in new unit test --- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 72f340e998f..94fe22c3634 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -6110,13 +6110,13 @@ namespace OutputProcessor { EXPECT_EQ(1, state->dataOutputProcessor->EndUseCategory(2).NumSubcategories); EXPECT_EQ("General", state->dataOutputProcessor->EndUseCategory(2).SubcategoryName(1)); - found = UtilityRoutines::FindItem("Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("Cooling", state->dataOutputProcessor->EnergyMeters(found).EndUse); EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); - found = UtilityRoutines::FindItem("General:Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("General:Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("Cooling", state->dataOutputProcessor->EnergyMeters(found).EndUse); @@ -6127,16 +6127,16 @@ namespace OutputProcessor { EXPECT_EQ(1, state->dataOutputProcessor->EndUseCategory(3).NumSubcategories); // lighting end use EXPECT_EQ("RailroadCrossing", state->dataOutputProcessor->EndUseCategory(3).SubcategoryName(1)); - found = UtilityRoutines::FindItem("InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("InteriorLights", state->dataOutputProcessor->EnergyMeters(found).EndUse); EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); - found = UtilityRoutines::FindItem("General:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("General:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_EQ(0, found); // should not find this - found = UtilityRoutines::FindItem("RailroadCrossing:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("RailroadCrossing:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("InteriorLights", state->dataOutputProcessor->EnergyMeters(found).EndUse); @@ -6144,7 +6144,7 @@ namespace OutputProcessor { // fuel oil CO2 emissions // testing a non-ABUPS end use with no sub end use specified - found = UtilityRoutines::FindItem("FuelOilNo2Emissions:CO2", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("FuelOilNo2Emissions:CO2", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("CO2", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("FuelOilNo2Emissions", state->dataOutputProcessor->EnergyMeters(found).EndUse); From 77246af35f80e46027916455e12b477e8fbf5e92 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 30 Oct 2023 14:45:00 -0500 Subject: [PATCH 44/50] Add exceptions for the new enums, we could consider changing them instead but not right now --- scripts/dev/check_for_malformed_enums.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/dev/check_for_malformed_enums.py b/scripts/dev/check_for_malformed_enums.py index 6a6bd7333cb..ad55eb53b63 100644 --- a/scripts/dev/check_for_malformed_enums.py +++ b/scripts/dev/check_for_malformed_enums.py @@ -110,6 +110,7 @@ def process_enum_str(input_str: str, file_name: str, line_no: int, print_errors: "CsvParser.hh:Token", "IdfParser.hh:Token", "OutputProcessor.hh:ReportingFrequency", + "OutputProcessor.hh:ReportFreqSOV", "HVACInterfaceManager.cc:UpdateType", "DataHeatBalance.hh:PERptVars", ] @@ -149,7 +150,10 @@ def process_enum_str(input_str: str, file_name: str, line_no: int, print_errors: # check for proper casing if str(name[0]).islower(): # exceptions listed by : - exceptions = ["DataGlobalConstants.hh:eResource", "DataGlobalConstants.hh:eFuel", "DataGlobalConstants.hh:ePollutant"] + exceptions = [ + "DataGlobalConstants.hh:eResource", "DataGlobalConstants.hh:eFuel", + "DataGlobalConstants.hh:ePollutant", "OutputProcessor.hh:eResourceSOV" + ] if f"{file_name}:{name}" not in exceptions: error_str += "\tenum name must begin with upper case letter\n" From 2eef9a47f59ccb12ade8a68e5a9275ca778eebdc Mon Sep 17 00:00:00 2001 From: amirroth Date: Wed, 1 Nov 2023 11:45:03 -0400 Subject: [PATCH 45/50] Fix some diffs, address Cpp-check comments --- src/EnergyPlus/PollutionModule.cc | 46 ++++++++++++++++++++----------- src/EnergyPlus/PollutionModule.hh | 17 ++++++++++++ 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index 0db3673f5b8..2e848e30835 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -277,9 +277,18 @@ void GetPollutionFactorInput(EnergyPlusData &state) ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - Constant::eFuel fuel = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(1)))); + PollFuel pollFuel = static_cast(getEnumValue(pollFuelNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(1)))); + if (pollFuel == PollFuel::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); + ErrorsFound = true; + continue; + } - auto &pollCoeff = pm->pollCoeffs[(int)fuel]; + pm->pollFuelFactorList.push_back(pollFuel); + + auto &pollCoeff = pm->pollCoeffs[(int)pollFuel]; + Constant::eFuel fuel = pollFuel2fuel[(int)pollFuel]; + if (pollCoeff.used) { ShowWarningError(state, format("{}: {} already entered. Previous entry will be used.", ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel])); @@ -288,7 +297,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) pollCoeff.used = true; - pollCoeff.sourceSchedNum = ipsc->rNumericArgs(1); + pollCoeff.sourceCoeff = ipsc->rNumericArgs(1); if (!ipsc->lAlphaFieldBlanks(2)) { pollCoeff.sourceSchedNum = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(2)); if (pollCoeff.sourceSchedNum == 0) { @@ -426,13 +435,18 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) pm->GetInputFlagPollution = false; } - for (int iFuel = 0; iFuel < (int)PollFuel::Num; ++iFuel) { + // We are using this list rather than the enumeration to preserve the order in which meters are created to avoid ordering diffs. + for (PollFuel pollFuel : pm->pollFuelFactorList) { - auto &pollComp = pm->pollComps[(int)pollFuel2pollFuelComponent[iFuel]]; + if (!pm->pollCoeffs[(int)pollFuel].used) continue; + + auto &pollComp = pm->pollComps[(int)pollFuel2pollFuelComponent[(int)pollFuel]]; + + Constant::eFuel fuel = pollFuel2fuel[(int)pollFuel]; // Need to check whether this fuel is used? SetupOutputVariable(state, - format("Environmental Impact {} Source Energy", Constant::eFuelNames[(int)pollFuel2fuel[iFuel]]), + format("Environmental Impact {} Source Energy", Constant::eFuelNames[(int)fuel]), OutputProcessor::Unit::J, pollComp.sourceVal, OutputProcessor::SOVTimeStepType::System, @@ -440,14 +454,14 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) "Site", {}, "Source", - format("{}Emissions", Constant::eFuelNames[(int)pollFuel2fuel[iFuel]]), + format("{}Emissions", Constant::eFuelNames[(int)fuel]), {}, ""); for (int iPollutant2 = 0; iPollutant2 < (int)Pollutant2::Num; ++iPollutant2) { SetupOutputVariable(state, format("Environmental Impact {} {}", - Constant::eFuelNames[(int)pollFuel2fuel[iFuel]], poll2outVarStrs[iPollutant2]), + Constant::eFuelNames[(int)fuel], poll2outVarStrs[iPollutant2]), poll2Units[iPollutant2], pollComp.pollutantVals[iPollutant2], OutputProcessor::SOVTimeStepType::System, @@ -455,7 +469,7 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) "Site", {}, poll2Names[iPollutant2], - format("{}Emissions", Constant::eFuelNames[(int)pollFuel2fuel[iFuel]]), + format("{}Emissions", Constant::eFuelNames[(int)fuel]), {}, ""); } @@ -535,7 +549,7 @@ void CheckPollutionMeterReporting(EnergyPlusData &state) // in progress (what is in progress?) - auto &pm = state.dataPollution; + auto const &pm = state.dataPollution; if (pm->NumFuelFactors == 0 || pm->NumEnvImpactFactors == 0) { if (ReportingThisVariable(state, "Environmental Impact Total N2O Emissions Carbon Equivalent Mass") || @@ -608,11 +622,11 @@ void CalcPollution(EnergyPlusData &state) } // does not include district heating or steam - auto const &pollCoeff = pm->pollCoeffs[(int)PollFuel::NaturalGas]; - auto &pollComp = pm->pollComps[(int)PollFuelComponent::NaturalGas]; - pollComp.sourceVal = pm->facilityMeterVals[(int)PollFacilityMeter::NaturalGas] * pollCoeff.sourceCoeff; - if (pollCoeff.sourceSchedNum != 0) { - pollComp.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.sourceSchedNum); + auto const &pollCoeffGas = pm->pollCoeffs[(int)PollFuel::NaturalGas]; + auto &pollCompGas = pm->pollComps[(int)PollFuelComponent::NaturalGas]; + pollCompGas.sourceVal = pm->facilityMeterVals[(int)PollFacilityMeter::NaturalGas] * pollCoeffGas.sourceCoeff; + if (pollCoeffGas.sourceSchedNum != 0) { + pollCompGas.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeffGas.sourceSchedNum); } for (PollFuel pollFuel : {PollFuel::FuelOil1, PollFuel::FuelOil2, PollFuel::Diesel, PollFuel::Gasoline, @@ -755,7 +769,7 @@ void GetEnvironmentalImpactFactorInfo(EnergyPlusData &state, // This routine allows access to data inside this module from other modules (specifically the // output tabular reports. - auto &pm = state.dataPollution; + auto const &pm = state.dataPollution; if (pm->GetInputFlagPollution) { GetPollutionFactorInput(state); pm->GetInputFlagPollution = false; diff --git a/src/EnergyPlus/PollutionModule.hh b/src/EnergyPlus/PollutionModule.hh index 9183ea801be..7bdef2d2f05 100644 --- a/src/EnergyPlus/PollutionModule.hh +++ b/src/EnergyPlus/PollutionModule.hh @@ -184,6 +184,19 @@ namespace Pollution { Constant::eFuel::OtherFuel2 // OtherFuel2 }; + constexpr std::array pollFuelNamesUC = { + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Electricity]], // Electricity + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::NaturalGas]], // NaturalGas + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::FuelOil1]], // FuelOil1 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::FuelOil2]], // FuelOil2 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Coal]], // Coal + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Gasoline]], // Gasoline + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Propane]], // Propane + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Diesel]], // Diesel + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::OtherFuel1]], // OtherFuel1 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::OtherFuel2]] // OtherFuel2 + }; + enum class PollFuelComponent { Invalid = -1, @@ -332,6 +345,8 @@ struct PollutionData : BaseGlobalStruct std::array pollutantVals; + std::vector pollFuelFactorList; + // Total Carbon Equivalent Components Real64 TotCarbonEquivFromN2O; Real64 TotCarbonEquivFromCH4; @@ -353,6 +368,8 @@ struct PollutionData : BaseGlobalStruct this->GetInputFlagPollution = true; this->NumEnvImpactFactors = 0; this->NumFuelFactors = 0; + + this->pollFuelFactorList.clear(); } }; From 34a2e8c3a28e8968689dc9938945831191515398 Mon Sep 17 00:00:00 2001 From: amirroth Date: Wed, 1 Nov 2023 13:58:30 -0400 Subject: [PATCH 46/50] Fix unit test --- tst/EnergyPlus/unit/PollutionModule.unit.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tst/EnergyPlus/unit/PollutionModule.unit.cc b/tst/EnergyPlus/unit/PollutionModule.unit.cc index 5b2a2652dd3..45e136f9ed9 100644 --- a/tst/EnergyPlus/unit/PollutionModule.unit.cc +++ b/tst/EnergyPlus/unit/PollutionModule.unit.cc @@ -472,8 +472,9 @@ TEST_F(EnergyPlusFixture, PollutionModule_TestOutputVariables) Pollution::SetupPollutionMeterReporting(*state); // Test get output variables for Total Sky Cover and Opaque Sky Cover - for (int i = 0; i < (int)PollFuel::Num; i++) { - std::string_view fuelName = Constant::eFuelNames[(int)pollFuel2fuel[i]]; + for (int i = 0; i < (int)state->dataPollution->pollFuelFactorList.size(); ++i) { + PollFuel pollFuel = state->dataPollution->pollFuelFactorList[i]; + std::string_view fuelName = Constant::eFuelNames[(int)pollFuel2fuel[(int)pollFuel]]; EXPECT_EQ(format("Site:Environmental Impact {} Source Energy", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 1).VarName); @@ -513,17 +514,17 @@ TEST_F(EnergyPlusFixture, PollutionModule_TestOutputVariables) // Variables specific to the Electricity fuel type EXPECT_EQ("Site:Environmental Impact Purchased Electricity Source Energy", - state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 1).VarName); + state->dataOutputProcessor->RVariableTypes((int)state->dataPollution->pollFuelFactorList.size() * 17 + 1).VarName); EXPECT_EQ("Site:Environmental Impact Surplus Sold Electricity Source", - state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 2).VarName); + state->dataOutputProcessor->RVariableTypes((int)state->dataPollution->pollFuelFactorList.size() * 17 + 2).VarName); // Variables always setup for total carbon equivalent EXPECT_EQ("Site:Environmental Impact Total N2O Emissions Carbon Equivalent Mass", - state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 3).VarName); + state->dataOutputProcessor->RVariableTypes((int)state->dataPollution->pollFuelFactorList.size() * 17 + 3).VarName); EXPECT_EQ("Site:Environmental Impact Total CH4 Emissions Carbon Equivalent Mass", - state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 4).VarName); + state->dataOutputProcessor->RVariableTypes((int)state->dataPollution->pollFuelFactorList.size() * 17 + 4).VarName); EXPECT_EQ("Site:Environmental Impact Total CO2 Emissions Carbon Equivalent Mass", - state->dataOutputProcessor->RVariableTypes((int)PollFuel::Num * 17 + 5).VarName); + state->dataOutputProcessor->RVariableTypes((int)state->dataPollution->pollFuelFactorList.size() * 17 + 5).VarName); } TEST_F(EnergyPlusFixture, PollutionModule_TestEnvironmentalImpactFactors) From 01744decd3c3c7ecb1aebaf572fc092ed170213e Mon Sep 17 00:00:00 2001 From: amirroth Date: Sat, 4 Nov 2023 10:35:18 -0400 Subject: [PATCH 47/50] Fix some more diffs --- src/EnergyPlus/PollutionModule.cc | 19 +++++++++++++++---- src/EnergyPlus/PollutionModule.hh | 24 ++++++++++++------------ 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index 2e848e30835..e4ed5977949 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -586,25 +586,36 @@ void CalcPollution(EnergyPlusData &state) // For each pollution/fuel type, Schedule values are allowed. Thus, calculations are bundled. auto &pm = state.dataPollution; - for (int iPoll = 0; iPoll < (int)Constant::ePollutant::Num; ++iPoll) { + for (int iPoll = 0; iPoll < (int)Pollutant2::Num; ++iPoll) { + pm->pollutantVals[iPoll] = 0.0; + for (int iPollFuel = 0; iPollFuel < (int)PollFuel::Num; ++iPollFuel) { auto &pollCoeff = pm->pollCoeffs[iPollFuel]; - auto &pollComp = pm->pollComps[(int)pollFuel2pollFuelComponent[iPollFuel]]; + PollFuelComponent pollFuelComp = pollFuel2pollFuelComponent[iPollFuel]; + auto &pollComp = pm->pollComps[(int)pollFuelComp]; if (pollCoeff.used) { pollComp.pollutantVals[iPoll] = 0.0; - Real64 pollutantVal = pollCoeff.pollutantCoeffs[iPoll] * 0.001; + Real64 pollutantVal = pollCoeff.pollutantCoeffs[iPoll]; + + // Why are these two the exceptions? + if (iPoll != (int)Pollutant2::Water && iPoll != (int)Pollutant2::NuclearLow) pollutantVal *= 0.001; + if (pollCoeff.pollutantSchedNums[iPoll] != 0) { pollutantVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.pollutantSchedNums[iPoll]); } pollComp.pollutantVals[iPoll] = - pm->facilityMeterFuelComponentVals[(int)pollFuel2pollFuelComponent[iPollFuel]] * 1.0e-6 * pollutantVal; + pm->facilityMeterFuelComponentVals[(int)pollFuelComp] * 1.0e-6 * pollutantVal; } pm->pollutantVals[iPoll] += pollComp.pollutantVals[iPoll]; } // for (iPollFactor) } // for (iPoll) + pm->TotCarbonEquivFromN2O = pm->pollutantVals[(int)Pollutant2::N2O] * pm->CarbonEquivN2O; + pm->TotCarbonEquivFromCH4 = pm->pollutantVals[(int)Pollutant2::CH4] * pm->CarbonEquivCH4; + pm->TotCarbonEquivFromCO2 = pm->pollutantVals[(int)Pollutant2::CO2] * pm->CarbonEquivCO2; + auto const &pollCoeffElec = pm->pollCoeffs[(int)PollFuel::Electricity]; auto &pollCompElec = pm->pollComps[(int)PollFuelComponent::Electricity]; auto &pollCompElecPurchased = pm->pollComps[(int)PollFuelComponent::ElectricityPurchased]; diff --git a/src/EnergyPlus/PollutionModule.hh b/src/EnergyPlus/PollutionModule.hh index 7bdef2d2f05..87c4518f2f0 100644 --- a/src/EnergyPlus/PollutionModule.hh +++ b/src/EnergyPlus/PollutionModule.hh @@ -275,27 +275,27 @@ namespace Pollution { "Diesel:Facility", "OtherFuel1:Facility", "OtherFuel2:Facility", - "ElectricitySurplusSold:Facility" + "ElectricitySurplusSold:Facility", "ElectricityPurchased:Facility", "ElectricityProduced:Facility", - "Steam:Facility", - "DistrictHeating:Facility", + "DistrictHeatingSteam:Facility", + "DistrictHeatingWater:Facility", "DistrictCooling:Facility" }; struct ComponentProps { Real64 sourceVal = 0.0; - std::array pollutantVals = {0.0}; + std::array pollutantVals = {0.0}; }; struct CoefficientProps { bool used = false; Real64 sourceCoeff = 0.0; - std::array pollutantCoeffs = {0.0}; + std::array pollutantCoeffs = {0.0}; int sourceSchedNum = 0; - std::array pollutantSchedNums = {0}; + std::array pollutantSchedNums = {0}; }; void CalculatePollution(EnergyPlusData &state); @@ -339,18 +339,18 @@ struct PollutionData : BaseGlobalStruct std::array pollComps; // Meters, meter values, and grouped meter values - std::array facilityMeterNums; - std::array facilityMeterVals; + std::array facilityMeterNums = {-1}; + std::array facilityMeterVals = {0.0}; std::array facilityMeterFuelComponentVals = {0.0}; - std::array pollutantVals; + std::array pollutantVals = {0.0}; std::vector pollFuelFactorList; // Total Carbon Equivalent Components - Real64 TotCarbonEquivFromN2O; - Real64 TotCarbonEquivFromCH4; - Real64 TotCarbonEquivFromCO2; + Real64 TotCarbonEquivFromN2O = 0.0; + Real64 TotCarbonEquivFromCH4 = 0.0; + Real64 TotCarbonEquivFromCO2 = 0.0; // Fuel Type Coefficients std::array pollCoeffs; // Total Carbon Equivalent Coeffs From 6e1406afe171b5ed01329fcab82825af03ab0551 Mon Sep 17 00:00:00 2001 From: amirroth Date: Sat, 4 Nov 2023 19:26:57 -0400 Subject: [PATCH 48/50] Merge develop, fix meter ordering --- src/EnergyPlus/PollutionModule.cc | 56 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index e4ed5977949..a3391d15584 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -473,33 +473,37 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) {}, ""); } - } // End of the NumEnergyTypes Do Loop - // Setup ElectricityPurchased and ElectricitySold variables - SetupOutputVariable(state, - "Environmental Impact Purchased Electricity Source Energy", - OutputProcessor::Unit::J, - pm->pollComps[(int)PollFuelComponent::ElectricityPurchased].sourceVal, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "PurchasedElectricityEmissions", - {}, - ""); - SetupOutputVariable(state, - "Environmental Impact Surplus Sold Electricity Source", - OutputProcessor::Unit::J, - pm->pollComps[(int)PollFuelComponent::ElectricitySurplusSold].sourceVal, - OutputProcessor::SOVTimeStepType::System, - OutputProcessor::SOVStoreType::Summed, - "Site", - {}, - "Source", - "SoldElectricityEmissions", - {}, - ""); + if (fuel == Constant::eFuel::Electricity) { + // Setup ElectricityPurchased and ElectricitySold variables + // Doing this here as opposed to outside the outer loop to preserve meter order and reduce ordering diffs + SetupOutputVariable(state, + "Environmental Impact Purchased Electricity Source Energy", + OutputProcessor::Unit::J, + pm->pollComps[(int)PollFuelComponent::ElectricityPurchased].sourceVal, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Source", + "PurchasedElectricityEmissions", + {}, + ""); + SetupOutputVariable(state, + "Environmental Impact Surplus Sold Electricity Source", + OutputProcessor::Unit::J, + pm->pollComps[(int)PollFuelComponent::ElectricitySurplusSold].sourceVal, + OutputProcessor::SOVTimeStepType::System, + OutputProcessor::SOVStoreType::Summed, + "Site", + {}, + "Source", + "SoldElectricityEmissions", + {}, + ""); + } + + } // End of the NumEnergyTypes Do Loop // And Total Carbon Equivalent variables SetupOutputVariable(state, From 35a398f14000df953d3cd3308331981b3ec3f330 Mon Sep 17 00:00:00 2001 From: amirroth Date: Sat, 4 Nov 2023 22:47:32 -0400 Subject: [PATCH 49/50] Fix string diffs, final cleanup --- src/EnergyPlus/DataGlobalConstants.hh | 82 +-------------------------- src/EnergyPlus/PollutionModule.cc | 24 ++++---- src/EnergyPlus/PollutionModule.hh | 18 +++--- 3 files changed, 21 insertions(+), 103 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index cb58fcdf3a2..fcb6a187783 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -151,27 +151,7 @@ namespace Constant { Num }; - enum class ePollutant - { - Invalid = -1, - SO2, - NOx, - N2O, - PM, - PM2_5, - PM10, - CO, - CO2, - CH4, - NH3, - NMVOC, - Hg, - Pb, - NuclearHigh, - NuclearLow, - Num - }; - + constexpr std::array(eResource::Num)> eResource2eFuel = {eFuel::Electricity, eFuel::NaturalGas, eFuel::Gasoline, @@ -237,32 +217,6 @@ namespace Constant { eResource::Water, eResource::None}; - constexpr std::array(eResource::Num)> eResource2ePollutant = { - ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, - ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, - ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, - ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, - ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, - ePollutant::Invalid, ePollutant::Invalid, ePollutant::Invalid, ePollutant::SO2, ePollutant::NOx, ePollutant::N2O, - ePollutant::PM, ePollutant::PM2_5, ePollutant::PM10, ePollutant::CO, ePollutant::CO2, ePollutant::CH4, - ePollutant::NH3, ePollutant::NMVOC, ePollutant::Hg, ePollutant::Pb, ePollutant::NuclearHigh, ePollutant::NuclearLow}; - - constexpr std::array(ePollutant::Num)> ePollutant2eResource = {eResource::SO2, - eResource::NOx, - eResource::N2O, - eResource::PM, - eResource::PM2_5, - eResource::PM10, - eResource::CO, - eResource::CO2, - eResource::CH4, - eResource::NH3, - eResource::NMVOC, - eResource::Hg, - eResource::Pb, - eResource::NuclearHigh, - eResource::NuclearLow}; - static constexpr std::array(eResource::Num)> eResourceNamesUC = {"ELECTRICITY", "NATURALGAS", "GASOLINE", @@ -395,40 +349,6 @@ namespace Constant { eResourceNames[static_cast(eFuel2eResource[static_cast(eFuel::Water)])], eResourceNames[static_cast(eFuel2eResource[static_cast(eFuel::None)])]}; - static constexpr std::array(ePollutant::Num)> ePollutantNamesUC = { - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::SO2)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::NOx)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::N2O)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::PM)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::PM2_5)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::PM10)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::CO)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::CO2)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::CH4)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::NH3)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::NMVOC)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::Hg)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::Pb)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::NuclearHigh)])], - eResourceNamesUC[static_cast(ePollutant2eResource[static_cast(ePollutant::NuclearLow)])]}; - - static constexpr std::array(ePollutant::Num)> ePollutantNames = { - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::SO2)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::NOx)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::N2O)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::PM)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::PM2_5)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::PM10)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::CO)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::CO2)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::CH4)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::NH3)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::NMVOC)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::Hg)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::Pb)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::NuclearHigh)])], - eResourceNames[static_cast(ePollutant2eResource[static_cast(ePollutant::NuclearLow)])]}; - enum class CallIndicator { Invalid = -1, diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index a3391d15584..9b98f98372d 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -312,7 +312,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) } } - for (int iPollutant = 0; iPollutant < (int)Pollutant2::Num; ++iPollutant) { + for (int iPollutant = 0; iPollutant < (int)Pollutant::Num; ++iPollutant) { pollCoeff.pollutantCoeffs[iPollutant] = ipsc->rNumericArgs(iPollutant+2); if (!ipsc->lAlphaFieldBlanks(iPollutant+3)) { @@ -458,17 +458,17 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) {}, ""); - for (int iPollutant2 = 0; iPollutant2 < (int)Pollutant2::Num; ++iPollutant2) { + for (int iPollutant = 0; iPollutant < (int)Pollutant::Num; ++iPollutant) { SetupOutputVariable(state, format("Environmental Impact {} {}", - Constant::eFuelNames[(int)fuel], poll2outVarStrs[iPollutant2]), - poll2Units[iPollutant2], - pollComp.pollutantVals[iPollutant2], + Constant::eFuelNames[(int)fuel], poll2outVarStrs[iPollutant]), + poll2Units[iPollutant], + pollComp.pollutantVals[iPollutant], OutputProcessor::SOVTimeStepType::System, OutputProcessor::SOVStoreType::Summed, "Site", {}, - poll2Names[iPollutant2], + poll2Names[iPollutant], format("{}Emissions", Constant::eFuelNames[(int)fuel]), {}, ""); @@ -564,7 +564,7 @@ void CheckPollutionMeterReporting(EnergyPlusData &state) ShowWarningError( state, "GetPollutionFactorInput: Requested reporting for Carbon Equivalent Pollution, but insufficient information is entered."); ShowContinueError( - state, "(Both \"FuelFactors\" and \"EnvironmentalImpactFactors\" must be entered or the displayed carbon pollution will all be zero.)"); + state, "Both \"FuelFactors\" and \"EnvironmentalImpactFactors\" must be entered or the displayed carbon pollution will all be zero."); } } } @@ -590,7 +590,7 @@ void CalcPollution(EnergyPlusData &state) // For each pollution/fuel type, Schedule values are allowed. Thus, calculations are bundled. auto &pm = state.dataPollution; - for (int iPoll = 0; iPoll < (int)Pollutant2::Num; ++iPoll) { + for (int iPoll = 0; iPoll < (int)Pollutant::Num; ++iPoll) { pm->pollutantVals[iPoll] = 0.0; for (int iPollFuel = 0; iPollFuel < (int)PollFuel::Num; ++iPollFuel) { @@ -603,7 +603,7 @@ void CalcPollution(EnergyPlusData &state) Real64 pollutantVal = pollCoeff.pollutantCoeffs[iPoll]; // Why are these two the exceptions? - if (iPoll != (int)Pollutant2::Water && iPoll != (int)Pollutant2::NuclearLow) pollutantVal *= 0.001; + if (iPoll != (int)Pollutant::Water && iPoll != (int)Pollutant::NuclearLow) pollutantVal *= 0.001; if (pollCoeff.pollutantSchedNums[iPoll] != 0) { pollutantVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.pollutantSchedNums[iPoll]); @@ -616,9 +616,9 @@ void CalcPollution(EnergyPlusData &state) } // for (iPollFactor) } // for (iPoll) - pm->TotCarbonEquivFromN2O = pm->pollutantVals[(int)Pollutant2::N2O] * pm->CarbonEquivN2O; - pm->TotCarbonEquivFromCH4 = pm->pollutantVals[(int)Pollutant2::CH4] * pm->CarbonEquivCH4; - pm->TotCarbonEquivFromCO2 = pm->pollutantVals[(int)Pollutant2::CO2] * pm->CarbonEquivCO2; + pm->TotCarbonEquivFromN2O = pm->pollutantVals[(int)Pollutant::N2O] * pm->CarbonEquivN2O; + pm->TotCarbonEquivFromCH4 = pm->pollutantVals[(int)Pollutant::CH4] * pm->CarbonEquivCH4; + pm->TotCarbonEquivFromCO2 = pm->pollutantVals[(int)Pollutant::CO2] * pm->CarbonEquivCO2; auto const &pollCoeffElec = pm->pollCoeffs[(int)PollFuel::Electricity]; auto &pollCompElec = pm->pollComps[(int)PollFuelComponent::Electricity]; diff --git a/src/EnergyPlus/PollutionModule.hh b/src/EnergyPlus/PollutionModule.hh index 87c4518f2f0..7716b24437b 100644 --- a/src/EnergyPlus/PollutionModule.hh +++ b/src/EnergyPlus/PollutionModule.hh @@ -61,9 +61,7 @@ namespace EnergyPlus { namespace Pollution { - // This is very similar to ePollutant in DataGlobalConstants, but - // also includes water. Water is a pollutant? Really? - enum class Pollutant2 + enum class Pollutant { Invalid = -1, CO2, @@ -85,10 +83,10 @@ namespace Pollution { Num }; - constexpr std::array poll2Names = { + constexpr std::array poll2Names = { "CO2", "CO", "CH4", "NOx", "N2O", "SO2", "PM", "PM10", "PM2.5", "NH3", "NMVOC", "Hg", "Pb", "WaterEnvironmentalFactors", "Nuclear High", "Nuclear Low"}; - constexpr std::array poll2Units = { + constexpr std::array poll2Units = { OutputProcessor::Unit::kg, // CO2 OutputProcessor::Unit::kg, // CO OutputProcessor::Unit::kg, // CH4 @@ -107,7 +105,7 @@ namespace Pollution { OutputProcessor::Unit::m3, // NuclearLow }; - constexpr std::array poll2outVarStrs = { + constexpr std::array poll2outVarStrs = { "CO2 Emissions Mass", // CO2 "CO Emissions Mass", // CO "CH4 Emissions Mass", // CH4 @@ -286,16 +284,16 @@ namespace Pollution { struct ComponentProps { Real64 sourceVal = 0.0; - std::array pollutantVals = {0.0}; + std::array pollutantVals = {0.0}; }; struct CoefficientProps { bool used = false; Real64 sourceCoeff = 0.0; - std::array pollutantCoeffs = {0.0}; + std::array pollutantCoeffs = {0.0}; int sourceSchedNum = 0; - std::array pollutantSchedNums = {0}; + std::array pollutantSchedNums = {0}; }; void CalculatePollution(EnergyPlusData &state); @@ -343,7 +341,7 @@ struct PollutionData : BaseGlobalStruct std::array facilityMeterVals = {0.0}; std::array facilityMeterFuelComponentVals = {0.0}; - std::array pollutantVals = {0.0}; + std::array pollutantVals = {0.0}; std::vector pollFuelFactorList; From bc927557c839641e65ebace28c9466dc979c4fc4 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 6 Nov 2023 13:59:08 -0600 Subject: [PATCH 50/50] Clang format --- src/EnergyPlus/DataGlobalConstants.hh | 1 - src/EnergyPlus/PollutionModule.cc | 165 ++++++++-------- src/EnergyPlus/PollutionModule.hh | 206 ++++++++++---------- tst/EnergyPlus/unit/PollutionModule.unit.cc | 11 +- 4 files changed, 196 insertions(+), 187 deletions(-) diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index fcb6a187783..6abbaff76a7 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -151,7 +151,6 @@ namespace Constant { Num }; - constexpr std::array(eResource::Num)> eResource2eFuel = {eFuel::Electricity, eFuel::NaturalGas, eFuel::Gasoline, diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index 9b98f98372d..1e8735b6304 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -202,7 +202,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) auto &ip = state.dataInputProcessing->inputProcessor; auto &ipsc = state.dataIPShortCut; auto &pm = state.dataPollution; - + if (!pm->GetInputFlagPollution) return; // Input already gotten pm->GetInputFlagPollution = false; @@ -226,7 +226,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) } else if (pm->PollutionReportSetup) { ShowWarningError(state, format("{}: not entered. Values will be defaulted.", ipsc->cCurrentModuleObject)); } - + pm->PurchHeatEffic = 0.3; pm->PurchCoolCOP = 3.0; pm->SteamConvEffic = 0.25; @@ -276,7 +276,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) ipsc->cNumericFieldNames); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - + PollFuel pollFuel = static_cast(getEnumValue(pollFuelNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(1)))); if (pollFuel == PollFuel::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); @@ -285,13 +285,13 @@ void GetPollutionFactorInput(EnergyPlusData &state) } pm->pollFuelFactorList.push_back(pollFuel); - + auto &pollCoeff = pm->pollCoeffs[(int)pollFuel]; Constant::eFuel fuel = pollFuel2fuel[(int)pollFuel]; - + if (pollCoeff.used) { - ShowWarningError(state, format("{}: {} already entered. Previous entry will be used.", - ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel])); + ShowWarningError( + state, format("{}: {} already entered. Previous entry will be used.", ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel])); continue; } @@ -304,29 +304,35 @@ void GetPollutionFactorInput(EnergyPlusData &state) ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } else if (!ScheduleManager::CheckScheduleValueMinMax(state, pollCoeff.sourceSchedNum, true, 0.0)) { - ShowSevereError(state, format("{}: {}, invalid {}=\"{}\" invalid values.", - ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel], - ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2))); + ShowSevereError(state, + format("{}: {}, invalid {}=\"{}\" invalid values.", + ipsc->cCurrentModuleObject, + Constant::eFuelNames[(int)fuel], + ipsc->cAlphaFieldNames(2), + ipsc->cAlphaArgs(2))); ShowContinueError(state, "Schedule values must be (>=0.)."); ErrorsFound = true; - } + } } for (int iPollutant = 0; iPollutant < (int)Pollutant::Num; ++iPollutant) { - pollCoeff.pollutantCoeffs[iPollutant] = ipsc->rNumericArgs(iPollutant+2); - if (!ipsc->lAlphaFieldBlanks(iPollutant+3)) { - - pollCoeff.pollutantSchedNums[iPollutant] = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(iPollutant+3)); + pollCoeff.pollutantCoeffs[iPollutant] = ipsc->rNumericArgs(iPollutant + 2); + if (!ipsc->lAlphaFieldBlanks(iPollutant + 3)) { + + pollCoeff.pollutantSchedNums[iPollutant] = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(iPollutant + 3)); if (pollCoeff.pollutantSchedNums[iPollutant] == 0) { - ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(iPollutant+3), ipsc->cAlphaArgs(iPollutant+3)); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(iPollutant + 3), ipsc->cAlphaArgs(iPollutant + 3)); ErrorsFound = true; } else if (!ScheduleManager::CheckScheduleValueMinMax(state, pollCoeff.pollutantSchedNums[iPollutant], true, 0.0)) { - ShowSevereError(state, format("{}: {}, invalid {}=\"{}\" invalid values.", - ipsc->cCurrentModuleObject, Constant::eFuelNames[(int)fuel], - ipsc->cAlphaFieldNames(iPollutant+3), ipsc->cAlphaArgs(iPollutant+3))); + ShowSevereError(state, + format("{}: {}, invalid {}=\"{}\" invalid values.", + ipsc->cCurrentModuleObject, + Constant::eFuelNames[(int)fuel], + ipsc->cAlphaFieldNames(iPollutant + 3), + ipsc->cAlphaArgs(iPollutant + 3))); ShowContinueError(state, "Schedule values must be (>=0.)."); ErrorsFound = true; - } + } } } // for (iPollutant) @@ -339,69 +345,61 @@ void GetPollutionFactorInput(EnergyPlusData &state) if (pm->PollutionReportSetup) { // only do this if reporting on the pollution // Need to go through all of the Fuel Types and make sure a Fuel Factor was found for each type of energy being simulated // Check for Electricity - if (!pm->pollCoeffs[(int)PollFuel::Electricity].used && - ((pm->facilityMeterNums[(int)PollFacilityMeter::Electricity] > 0) || - (pm->facilityMeterNums[(int)PollFacilityMeter::ElectricityProduced] > 0) || - (pm->facilityMeterNums[(int)PollFacilityMeter::CoolPurchased] > 0))) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for ELECTRICITY", - ipsc->cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::Electricity].used && ((pm->facilityMeterNums[(int)PollFacilityMeter::Electricity] > 0) || + (pm->facilityMeterNums[(int)PollFacilityMeter::ElectricityProduced] > 0) || + (pm->facilityMeterNums[(int)PollFacilityMeter::CoolPurchased] > 0))) { + ShowSevereError(state, + format("{} Not Found or Fuel not specified For Pollution Calculation for ELECTRICITY", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Natural Gas if (!pm->pollCoeffs[(int)PollFuel::NaturalGas].used && - ((pm->facilityMeterNums[(int)PollFacilityMeter::NaturalGas] > 0) || - (pm->facilityMeterNums[(int)PollFacilityMeter::HeatPurchased] > 0) || + ((pm->facilityMeterNums[(int)PollFacilityMeter::NaturalGas] > 0) || (pm->facilityMeterNums[(int)PollFacilityMeter::HeatPurchased] > 0) || (pm->facilityMeterNums[(int)PollFacilityMeter::Steam] > 0))) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for NATURAL GAS", - ipsc->cCurrentModuleObject)); + ShowSevereError(state, + format("{} Not Found or Fuel not specified For Pollution Calculation for NATURAL GAS", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for FuelOilNo2 (Residual Oil) - if (!pm->pollCoeffs[(int)PollFuel::FuelOil2].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::FuelOil2] > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #2", ipsc->cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::FuelOil2].used && (pm->facilityMeterNums[(int)PollFacilityMeter::FuelOil2] > 0)) { + ShowSevereError(state, + format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #2", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for FuelOilNo1 (Distillate Oil) - if (!pm->pollCoeffs[(int)PollFuel::FuelOil1].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::FuelOil1] > 0)) { - ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #1", ipsc->cCurrentModuleObject)); + if (!pm->pollCoeffs[(int)PollFuel::FuelOil1].used && (pm->facilityMeterNums[(int)PollFacilityMeter::FuelOil1] > 0)) { + ShowSevereError(state, + format("{} Not Found or Fuel not specified For Pollution Calculation for FUEL OIL #1", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Coal - if (!pm->pollCoeffs[(int)PollFuel::Coal].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::Coal] > 0)) { + if (!pm->pollCoeffs[(int)PollFuel::Coal].used && (pm->facilityMeterNums[(int)PollFacilityMeter::Coal] > 0)) { ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for COAL", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Gasoline - if (!pm->pollCoeffs[(int)PollFuel::Gasoline].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::Gasoline] > 0)) { + if (!pm->pollCoeffs[(int)PollFuel::Gasoline].used && (pm->facilityMeterNums[(int)PollFacilityMeter::Gasoline] > 0)) { ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for GASOLINE", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Propane - if (!pm->pollCoeffs[(int)PollFuel::Propane].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::Propane] > 0)) { + if (!pm->pollCoeffs[(int)PollFuel::Propane].used && (pm->facilityMeterNums[(int)PollFacilityMeter::Propane] > 0)) { ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for PROPANE", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for Diesel - if (!pm->pollCoeffs[(int)PollFuel::Diesel].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::Diesel] > 0)) { + if (!pm->pollCoeffs[(int)PollFuel::Diesel].used && (pm->facilityMeterNums[(int)PollFacilityMeter::Diesel] > 0)) { ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for DIESEL", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for OtherFuel1 - if (!pm->pollCoeffs[(int)PollFuel::OtherFuel1].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::OtherFuel1] > 0)) { + if (!pm->pollCoeffs[(int)PollFuel::OtherFuel1].used && (pm->facilityMeterNums[(int)PollFacilityMeter::OtherFuel1] > 0)) { ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for OTHERFUEL1", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Check for OtherFuel2 - if (!pm->pollCoeffs[(int)PollFuel::OtherFuel2].used && - (pm->facilityMeterNums[(int)PollFacilityMeter::OtherFuel2] > 0)) { + if (!pm->pollCoeffs[(int)PollFuel::OtherFuel2].used && (pm->facilityMeterNums[(int)PollFacilityMeter::OtherFuel2] > 0)) { ShowSevereError(state, format("{} Not Found or Fuel not specified For Pollution Calculation for OTHERFUEL2", ipsc->cCurrentModuleObject)); ErrorsFound = true; } @@ -429,7 +427,7 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: auto &pm = state.dataPollution; - + if (pm->GetInputFlagPollution) { GetPollutionFactorInput(state); pm->GetInputFlagPollution = false; @@ -439,11 +437,11 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) for (PollFuel pollFuel : pm->pollFuelFactorList) { if (!pm->pollCoeffs[(int)pollFuel].used) continue; - + auto &pollComp = pm->pollComps[(int)pollFuel2pollFuelComponent[(int)pollFuel]]; Constant::eFuel fuel = pollFuel2fuel[(int)pollFuel]; - + // Need to check whether this fuel is used? SetupOutputVariable(state, format("Environmental Impact {} Source Energy", Constant::eFuelNames[(int)fuel]), @@ -460,8 +458,7 @@ void SetupPollutionMeterReporting(EnergyPlusData &state) for (int iPollutant = 0; iPollutant < (int)Pollutant::Num; ++iPollutant) { SetupOutputVariable(state, - format("Environmental Impact {} {}", - Constant::eFuelNames[(int)fuel], poll2outVarStrs[iPollutant]), + format("Environmental Impact {} {}", Constant::eFuelNames[(int)fuel], poll2outVarStrs[iPollutant]), poll2Units[iPollutant], pollComp.pollutantVals[iPollutant], OutputProcessor::SOVTimeStepType::System, @@ -554,7 +551,7 @@ void CheckPollutionMeterReporting(EnergyPlusData &state) // in progress (what is in progress?) auto const &pm = state.dataPollution; - + if (pm->NumFuelFactors == 0 || pm->NumEnvImpactFactors == 0) { if (ReportingThisVariable(state, "Environmental Impact Total N2O Emissions Carbon Equivalent Mass") || ReportingThisVariable(state, "Environmental Impact Total CH4 Emissions Carbon Equivalent Mass") || @@ -569,7 +566,6 @@ void CheckPollutionMeterReporting(EnergyPlusData &state) } } - // End of Get Input subroutines for the Pollution Module //****************************************************************************** @@ -589,11 +585,11 @@ void CalcPollution(EnergyPlusData &state) // For each pollution/fuel type, Schedule values are allowed. Thus, calculations are bundled. auto &pm = state.dataPollution; - + for (int iPoll = 0; iPoll < (int)Pollutant::Num; ++iPoll) { pm->pollutantVals[iPoll] = 0.0; - for (int iPollFuel = 0; iPollFuel < (int)PollFuel::Num; ++iPollFuel) { + for (int iPollFuel = 0; iPollFuel < (int)PollFuel::Num; ++iPollFuel) { auto &pollCoeff = pm->pollCoeffs[iPollFuel]; PollFuelComponent pollFuelComp = pollFuel2pollFuelComponent[iPollFuel]; auto &pollComp = pm->pollComps[(int)pollFuelComp]; @@ -604,17 +600,16 @@ void CalcPollution(EnergyPlusData &state) // Why are these two the exceptions? if (iPoll != (int)Pollutant::Water && iPoll != (int)Pollutant::NuclearLow) pollutantVal *= 0.001; - + if (pollCoeff.pollutantSchedNums[iPoll] != 0) { pollutantVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.pollutantSchedNums[iPoll]); } - pollComp.pollutantVals[iPoll] = - pm->facilityMeterFuelComponentVals[(int)pollFuelComp] * 1.0e-6 * pollutantVal; + pollComp.pollutantVals[iPoll] = pm->facilityMeterFuelComponentVals[(int)pollFuelComp] * 1.0e-6 * pollutantVal; } pm->pollutantVals[iPoll] += pollComp.pollutantVals[iPoll]; } // for (iPollFactor) - } // for (iPoll) + } // for (iPoll) pm->TotCarbonEquivFromN2O = pm->pollutantVals[(int)Pollutant::N2O] * pm->CarbonEquivN2O; pm->TotCarbonEquivFromCH4 = pm->pollutantVals[(int)Pollutant::CH4] * pm->CarbonEquivCH4; @@ -624,10 +619,11 @@ void CalcPollution(EnergyPlusData &state) auto &pollCompElec = pm->pollComps[(int)PollFuelComponent::Electricity]; auto &pollCompElecPurchased = pm->pollComps[(int)PollFuelComponent::ElectricityPurchased]; auto &pollCompElecSurplusSold = pm->pollComps[(int)PollFuelComponent::ElectricitySurplusSold]; - + pollCompElec.sourceVal = pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] * pollCoeffElec.sourceCoeff; pollCompElecPurchased.sourceVal = pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricityPurchased] * pollCoeffElec.sourceCoeff; - pollCompElecSurplusSold.sourceVal = pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricitySurplusSold] * pollCoeffElec.sourceCoeff; + pollCompElecSurplusSold.sourceVal = + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricitySurplusSold] * pollCoeffElec.sourceCoeff; if (pollCoeffElec.sourceSchedNum != 0) { Real64 pollCoeffElecSchedVal = ScheduleManager::GetCurrentScheduleValue(state, pollCoeffElec.sourceSchedNum); @@ -635,21 +631,27 @@ void CalcPollution(EnergyPlusData &state) pollCompElecPurchased.sourceVal *= pollCoeffElecSchedVal; pollCompElecSurplusSold.sourceVal *= pollCoeffElecSchedVal; } - + // does not include district heating or steam auto const &pollCoeffGas = pm->pollCoeffs[(int)PollFuel::NaturalGas]; auto &pollCompGas = pm->pollComps[(int)PollFuelComponent::NaturalGas]; pollCompGas.sourceVal = pm->facilityMeterVals[(int)PollFacilityMeter::NaturalGas] * pollCoeffGas.sourceCoeff; if (pollCoeffGas.sourceSchedNum != 0) { - pollCompGas.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeffGas.sourceSchedNum); + pollCompGas.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeffGas.sourceSchedNum); } - for (PollFuel pollFuel : {PollFuel::FuelOil1, PollFuel::FuelOil2, PollFuel::Diesel, PollFuel::Gasoline, - PollFuel::Propane, PollFuel::Coal, PollFuel::OtherFuel1, PollFuel::OtherFuel2}) { + for (PollFuel pollFuel : {PollFuel::FuelOil1, + PollFuel::FuelOil2, + PollFuel::Diesel, + PollFuel::Gasoline, + PollFuel::Propane, + PollFuel::Coal, + PollFuel::OtherFuel1, + PollFuel::OtherFuel2}) { auto const &pollCoeff = pm->pollCoeffs[(int)pollFuel]; PollFuelComponent pollFuelComponent = pollFuel2pollFuelComponent[(int)pollFuel]; auto &pollComp = pm->pollComps[(int)pollFuelComponent]; - + pollComp.sourceVal = pm->facilityMeterFuelComponentVals[(int)pollFuelComponent] * pollCoeff.sourceCoeff; if (pollCoeff.sourceSchedNum != 0) { pollComp.sourceVal *= ScheduleManager::GetCurrentScheduleValue(state, pollCoeff.sourceSchedNum); @@ -672,7 +674,7 @@ void ReadEnergyMeters(EnergyPlusData &state) // Using/Aliasing Real64 FracTimeStepZone = state.dataHVACGlobal->FracTimeStepZone; auto &pm = state.dataPollution; - + for (int iMeter = 0; iMeter < (int)PollFacilityMeter::Num; ++iMeter) { pm->facilityMeterVals[iMeter] = GetInstantMeterValue(state, pm->facilityMeterNums[iMeter], OutputProcessor::TimeStepType::Zone) * FracTimeStepZone + @@ -687,8 +689,7 @@ void ReadEnergyMeters(EnergyPlusData &state) // defined COP. pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] = - pm->facilityMeterVals[(int)PollFacilityMeter::Electricity] - - pm->facilityMeterVals[(int)PollFacilityMeter::ElectricityProduced] + + pm->facilityMeterVals[(int)PollFacilityMeter::Electricity] - pm->facilityMeterVals[(int)PollFacilityMeter::ElectricityProduced] + pm->facilityMeterVals[(int)PollFacilityMeter::CoolPurchased] / pm->PurchCoolCOP; if (pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Electricity] < 0.0) @@ -708,8 +709,10 @@ void ReadEnergyMeters(EnergyPlusData &state) pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::Diesel] = pm->facilityMeterVals[(int)PollFacilityMeter::Diesel]; pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::OtherFuel1] = pm->facilityMeterVals[(int)PollFacilityMeter::OtherFuel1]; pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::OtherFuel2] = pm->facilityMeterVals[(int)PollFacilityMeter::OtherFuel2]; - pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricityPurchased] = pm->facilityMeterVals[(int)PollFacilityMeter::ElectricityPurchased]; - pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricitySurplusSold] = pm->facilityMeterVals[(int)PollFacilityMeter::ElectricitySurplusSold]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricityPurchased] = + pm->facilityMeterVals[(int)PollFacilityMeter::ElectricityPurchased]; + pm->facilityMeterFuelComponentVals[(int)PollFuelComponent::ElectricitySurplusSold] = + pm->facilityMeterVals[(int)PollFacilityMeter::ElectricitySurplusSold]; } // ***************************************************************************** @@ -717,11 +720,11 @@ void ReadEnergyMeters(EnergyPlusData &state) // ***************************************************************************** void GetFuelFactorInfo(EnergyPlusData &state, - Constant::eFuel fuel, // input fuel name (standard from Tabular reports) - bool &fuelFactorUsed, // return value true if user has entered this fuel - Real64 &fuelSourceFactor, // if used, the source factor - bool &fuelFactorScheduleUsed, // if true, schedules for this fuel are used - int &ffScheduleIndex // if schedules for this fuel are used, return schedule index + Constant::eFuel fuel, // input fuel name (standard from Tabular reports) + bool &fuelFactorUsed, // return value true if user has entered this fuel + Real64 &fuelSourceFactor, // if used, the source factor + bool &fuelFactorScheduleUsed, // if true, schedules for this fuel are used + int &ffScheduleIndex // if schedules for this fuel are used, return schedule index ) { @@ -733,7 +736,7 @@ void GetFuelFactorInfo(EnergyPlusData &state, // This routine allows access to data inside this module from other modules (specifically the // output tabular reports. auto &pm = state.dataPollution; - + if (pm->GetInputFlagPollution) { GetPollutionFactorInput(state); pm->GetInputFlagPollution = false; @@ -746,7 +749,7 @@ void GetFuelFactorInfo(EnergyPlusData &state, PollFuel pollFuel = fuel2pollFuel[(int)fuel]; auto const &pollCoeff = pm->pollCoeffs[(int)pollFuel]; - + if (pollCoeff.used) { fuelFactorUsed = true; fuelSourceFactor = pollCoeff.sourceCoeff; @@ -797,4 +800,4 @@ void GetEnvironmentalImpactFactorInfo(EnergyPlusData &state, } } -} // namespace EnergyPlus::PollutionModule +} // namespace EnergyPlus::Pollution diff --git a/src/EnergyPlus/PollutionModule.hh b/src/EnergyPlus/PollutionModule.hh index 7716b24437b..ff3ddac623a 100644 --- a/src/EnergyPlus/PollutionModule.hh +++ b/src/EnergyPlus/PollutionModule.hh @@ -83,8 +83,22 @@ namespace Pollution { Num }; - constexpr std::array poll2Names = { - "CO2", "CO", "CH4", "NOx", "N2O", "SO2", "PM", "PM10", "PM2.5", "NH3", "NMVOC", "Hg", "Pb", "WaterEnvironmentalFactors", "Nuclear High", "Nuclear Low"}; + constexpr std::array poll2Names = {"CO2", + "CO", + "CH4", + "NOx", + "N2O", + "SO2", + "PM", + "PM10", + "PM2.5", + "NH3", + "NMVOC", + "Hg", + "Pb", + "WaterEnvironmentalFactors", + "Nuclear High", + "Nuclear Low"}; constexpr std::array poll2Units = { OutputProcessor::Unit::kg, // CO2 @@ -100,30 +114,30 @@ namespace Pollution { OutputProcessor::Unit::kg, // NMVOC OutputProcessor::Unit::kg, // Hg OutputProcessor::Unit::kg, // Pb - OutputProcessor::Unit::L, // Water + OutputProcessor::Unit::L, // Water OutputProcessor::Unit::kg, // NuclearHigh OutputProcessor::Unit::m3, // NuclearLow }; constexpr std::array poll2outVarStrs = { - "CO2 Emissions Mass", // CO2 - "CO Emissions Mass", // CO - "CH4 Emissions Mass", // CH4 - "NOx Emissions Mass", // NOx - "N2O Emissions Mass", // N2O - "SO2 Emissions Mass", // SO2 - "PM Emissions Mass", // PM - "PM10 Emissions Mass", // PM10 - "PM2.5 Emissions Mass", // PM2_5 - "NH3 Emissions Mass", // NH3 - "NMVOC Emissions Mass", // NMVOC - "Hg Emissions Mass", // Hg - "Pb Emissions Mass", // Pb - "Water Consumption Volume", // Water - "Nuclear High Level Waste Mass", // NuclearHigh + "CO2 Emissions Mass", // CO2 + "CO Emissions Mass", // CO + "CH4 Emissions Mass", // CH4 + "NOx Emissions Mass", // NOx + "N2O Emissions Mass", // N2O + "SO2 Emissions Mass", // SO2 + "PM Emissions Mass", // PM + "PM10 Emissions Mass", // PM10 + "PM2.5 Emissions Mass", // PM2_5 + "NH3 Emissions Mass", // NH3 + "NMVOC Emissions Mass", // NMVOC + "Hg Emissions Mass", // Hg + "Pb Emissions Mass", // Pb + "Water Consumption Volume", // Water + "Nuclear High Level Waste Mass", // NuclearHigh "Nuclear Low Level Waste Volume", // NuclearLow }; - + enum class PollFuel { Invalid = -1, @@ -143,56 +157,56 @@ namespace Pollution { constexpr std::array pollFuelFactors = { 3.167, // Electricity 1.084, // NaturalGas - 1.05, // FuelOil1 - 1.05, // FuelOil2 - 1.05, // Coal - 1.05, // Gasoline - 1.05, // Propane - 1.05, // Diesel - 1.0, // OtherFuel1 - 1.0 // OtherFuel2 + 1.05, // FuelOil1 + 1.05, // FuelOil2 + 1.05, // Coal + 1.05, // Gasoline + 1.05, // Propane + 1.05, // Diesel + 1.0, // OtherFuel1 + 1.0 // OtherFuel2 }; - + constexpr std::array fuel2pollFuel = { PollFuel::Electricity, // Electricity - PollFuel::NaturalGas, // NaturalGas - PollFuel::Gasoline, // Gasoline - PollFuel::Diesel, // Diesel - PollFuel::Coal, // Coal - PollFuel::Propane, // Propane - PollFuel::FuelOil1, // FuelOilNo1 - PollFuel::FuelOil2, // FuelOilNo2 - PollFuel::OtherFuel1, // OtherFuel1 - PollFuel::OtherFuel2, // OtherFuel2 + PollFuel::NaturalGas, // NaturalGas + PollFuel::Gasoline, // Gasoline + PollFuel::Diesel, // Diesel + PollFuel::Coal, // Coal + PollFuel::Propane, // Propane + PollFuel::FuelOil1, // FuelOilNo1 + PollFuel::FuelOil2, // FuelOilNo2 + PollFuel::OtherFuel1, // OtherFuel1 + PollFuel::OtherFuel2, // OtherFuel2 PollFuel::Electricity, // DistrictCooling - PollFuel::NaturalGas, // DistrictHeating - PollFuel::NaturalGas, // Steam + PollFuel::NaturalGas, // DistrictHeating + PollFuel::NaturalGas, // Steam }; constexpr std::array pollFuel2fuel = { Constant::eFuel::Electricity, // Electricity - Constant::eFuel::NaturalGas, // NaturalGas - Constant::eFuel::FuelOilNo1, // FuelOil1 - Constant::eFuel::FuelOilNo2, // FuelOil2 - Constant::eFuel::Coal, // Coal - Constant::eFuel::Gasoline, // Gasoline - Constant::eFuel::Propane, // Propane - Constant::eFuel::Diesel, // Diesel - Constant::eFuel::OtherFuel1, // OtherFuel1 - Constant::eFuel::OtherFuel2 // OtherFuel2 + Constant::eFuel::NaturalGas, // NaturalGas + Constant::eFuel::FuelOilNo1, // FuelOil1 + Constant::eFuel::FuelOilNo2, // FuelOil2 + Constant::eFuel::Coal, // Coal + Constant::eFuel::Gasoline, // Gasoline + Constant::eFuel::Propane, // Propane + Constant::eFuel::Diesel, // Diesel + Constant::eFuel::OtherFuel1, // OtherFuel1 + Constant::eFuel::OtherFuel2 // OtherFuel2 }; constexpr std::array pollFuelNamesUC = { Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Electricity]], // Electricity - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::NaturalGas]], // NaturalGas - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::FuelOil1]], // FuelOil1 - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::FuelOil2]], // FuelOil2 - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Coal]], // Coal - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Gasoline]], // Gasoline - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Propane]], // Propane - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Diesel]], // Diesel - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::OtherFuel1]], // OtherFuel1 - Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::OtherFuel2]] // OtherFuel2 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::NaturalGas]], // NaturalGas + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::FuelOil1]], // FuelOil1 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::FuelOil2]], // FuelOil2 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Coal]], // Coal + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Gasoline]], // Gasoline + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Propane]], // Propane + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::Diesel]], // Diesel + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::OtherFuel1]], // OtherFuel1 + Constant::eFuelNamesUC[(int)pollFuel2fuel[(int)PollFuel::OtherFuel2]] // OtherFuel2 }; enum class PollFuelComponent @@ -213,20 +227,18 @@ namespace Pollution { Num }; - constexpr std::array pollFuelComp2pollFuel = { - PollFuel::Electricity, - PollFuel::NaturalGas, - PollFuel::FuelOil1, - PollFuel::FuelOil2, - PollFuel::Coal, - PollFuel::Gasoline, - PollFuel::Propane, - PollFuel::Diesel, - PollFuel::OtherFuel1, - PollFuel::OtherFuel2, - PollFuel::Electricity, - PollFuel::Electricity - }; + constexpr std::array pollFuelComp2pollFuel = {PollFuel::Electricity, + PollFuel::NaturalGas, + PollFuel::FuelOil1, + PollFuel::FuelOil2, + PollFuel::Coal, + PollFuel::Gasoline, + PollFuel::Propane, + PollFuel::Diesel, + PollFuel::OtherFuel1, + PollFuel::OtherFuel2, + PollFuel::Electricity, + PollFuel::Electricity}; constexpr std::array pollFuel2pollFuelComponent = { PollFuelComponent::Electricity, @@ -240,8 +252,9 @@ namespace Pollution { PollFuelComponent::OtherFuel1, PollFuelComponent::OtherFuel2, }; - - enum class PollFacilityMeter { + + enum class PollFacilityMeter + { Invalid = -1, Electricity, NaturalGas, @@ -261,25 +274,23 @@ namespace Pollution { CoolPurchased, Num }; - - constexpr std::array pollFacilityMeterNames = { - "Electricity:Facility", - "NaturalGas:Facility", - "FuelOilNo1:Facility", - "FuelOilNo2:Facility", - "Coal:Facility", - "Gasoline:Facility", - "Propane:Facility", - "Diesel:Facility", - "OtherFuel1:Facility", - "OtherFuel2:Facility", - "ElectricitySurplusSold:Facility", - "ElectricityPurchased:Facility", - "ElectricityProduced:Facility", - "DistrictHeatingSteam:Facility", - "DistrictHeatingWater:Facility", - "DistrictCooling:Facility" - }; + + constexpr std::array pollFacilityMeterNames = {"Electricity:Facility", + "NaturalGas:Facility", + "FuelOilNo1:Facility", + "FuelOilNo2:Facility", + "Coal:Facility", + "Gasoline:Facility", + "Propane:Facility", + "Diesel:Facility", + "OtherFuel1:Facility", + "OtherFuel2:Facility", + "ElectricitySurplusSold:Facility", + "ElectricityPurchased:Facility", + "ElectricityProduced:Facility", + "DistrictHeatingSteam:Facility", + "DistrictHeatingWater:Facility", + "DistrictCooling:Facility"}; struct ComponentProps { @@ -311,11 +322,11 @@ namespace Pollution { void ReadEnergyMeters(EnergyPlusData &state); void GetFuelFactorInfo(EnergyPlusData &state, - Constant::eFuel fuel, // input fuel name (standard from Tabular reports) - bool &fuelFactorUsed, // return value true if user has entered this fuel - Real64 &fuelSourceFactor, // if used, the source factor - bool &fuelFactorScheduleUsed, // if true, schedules for this fuel are used - int &ffScheduleIndex // if schedules for this fuel are used, return schedule index + Constant::eFuel fuel, // input fuel name (standard from Tabular reports) + bool &fuelFactorUsed, // return value true if user has entered this fuel + Real64 &fuelSourceFactor, // if used, the source factor + bool &fuelFactorScheduleUsed, // if true, schedules for this fuel are used + int &ffScheduleIndex // if schedules for this fuel are used, return schedule index ); void GetEnvironmentalImpactFactorInfo(EnergyPlusData &state, @@ -359,7 +370,6 @@ struct PollutionData : BaseGlobalStruct Real64 PurchCoolCOP = 0.0; Real64 SteamConvEffic = 0.0; - void clear_state() override { this->PollutionReportSetup = false; diff --git a/tst/EnergyPlus/unit/PollutionModule.unit.cc b/tst/EnergyPlus/unit/PollutionModule.unit.cc index 45e136f9ed9..b473cc596ca 100644 --- a/tst/EnergyPlus/unit/PollutionModule.unit.cc +++ b/tst/EnergyPlus/unit/PollutionModule.unit.cc @@ -475,13 +475,11 @@ TEST_F(EnergyPlusFixture, PollutionModule_TestOutputVariables) for (int i = 0; i < (int)state->dataPollution->pollFuelFactorList.size(); ++i) { PollFuel pollFuel = state->dataPollution->pollFuelFactorList[i]; std::string_view fuelName = Constant::eFuelNames[(int)pollFuel2fuel[(int)pollFuel]]; - - EXPECT_EQ(format("Site:Environmental Impact {} Source Energy", fuelName), - state->dataOutputProcessor->RVariableTypes(i * 17 + 1).VarName); + + EXPECT_EQ(format("Site:Environmental Impact {} Source Energy", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 1).VarName); EXPECT_EQ(format("Site:Environmental Impact {} CO2 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 2).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} CO Emissions Mass", fuelName), - state->dataOutputProcessor->RVariableTypes(i * 17 + 3).VarName); + EXPECT_EQ(format("Site:Environmental Impact {} CO Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 3).VarName); EXPECT_EQ(format("Site:Environmental Impact {} CH4 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 4).VarName); EXPECT_EQ(format("Site:Environmental Impact {} NOx Emissions Mass", fuelName), @@ -490,8 +488,7 @@ TEST_F(EnergyPlusFixture, PollutionModule_TestOutputVariables) state->dataOutputProcessor->RVariableTypes(i * 17 + 6).VarName); EXPECT_EQ(format("Site:Environmental Impact {} SO2 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 7).VarName); - EXPECT_EQ(format("Site:Environmental Impact {} PM Emissions Mass", fuelName), - state->dataOutputProcessor->RVariableTypes(i * 17 + 8).VarName); + EXPECT_EQ(format("Site:Environmental Impact {} PM Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 8).VarName); EXPECT_EQ(format("Site:Environmental Impact {} PM10 Emissions Mass", fuelName), state->dataOutputProcessor->RVariableTypes(i * 17 + 9).VarName); EXPECT_EQ(format("Site:Environmental Impact {} PM2.5 Emissions Mass", fuelName),