From efa32092ab5cf02dbc5abc76f2d3ec2c715ad46b Mon Sep 17 00:00:00 2001 From: amirroth Date: Mon, 31 Jul 2023 10:43:30 -0400 Subject: [PATCH] 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); }