Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Enums for SetupOutputVariable Arguments (Try 2) #8898

Merged
merged 12 commits into from
Jul 22, 2021
469 changes: 237 additions & 232 deletions src/EnergyPlus/AirflowNetworkBalanceManager.cc

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions src/EnergyPlus/BaseboardElectric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,24 +361,29 @@ namespace BaseboardElectric {
"Baseboard Total Heating Energy",
OutputProcessor::Unit::J,
thisBaseboard.Energy,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the kind of change in this PR -- lots of SetupOutputVariable calls changed from strings to the new enums.

thisBaseboard.EquipName,
_,
"ENERGYTRANSFER",
"BASEBOARD",
_,
"System");

SetupOutputVariable(
state, "Baseboard Total Heating Rate", OutputProcessor::Unit::W, thisBaseboard.Power, "System", "Average", thisBaseboard.EquipName);
SetupOutputVariable(state,
"Baseboard Total Heating Rate",
OutputProcessor::Unit::W,
thisBaseboard.Power,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
thisBaseboard.EquipName);

SetupOutputVariable(state,
"Baseboard Electricity Energy",
OutputProcessor::Unit::J,
thisBaseboard.ElecUseLoad,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
thisBaseboard.EquipName,
_,
"Electricity",
Expand All @@ -390,8 +395,8 @@ namespace BaseboardElectric {
"Baseboard Electricity Rate",
OutputProcessor::Unit::W,
thisBaseboard.ElecUseRate,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
thisBaseboard.EquipName);
}
}
Expand Down
36 changes: 18 additions & 18 deletions src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ namespace BaseboardRadiator {
"Baseboard Total Heating Energy",
OutputProcessor::Unit::J,
baseboard->Baseboard(BaseboardNum).Energy,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
baseboard->Baseboard(BaseboardNum).EquipID,
_,
"ENERGYTRANSFER",
Expand All @@ -485,8 +485,8 @@ namespace BaseboardRadiator {
"Baseboard Hot Water Energy",
OutputProcessor::Unit::J,
baseboard->Baseboard(BaseboardNum).Energy,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
baseboard->Baseboard(BaseboardNum).EquipID,
_,
"PLANTLOOPHEATINGDEMAND",
Expand All @@ -498,56 +498,56 @@ namespace BaseboardRadiator {
"Baseboard Total Heating Rate",
OutputProcessor::Unit::W,
baseboard->Baseboard(BaseboardNum).Power,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);

SetupOutputVariable(state,
"Baseboard Hot Water Mass Flow Rate",
OutputProcessor::Unit::kg_s,
baseboard->Baseboard(BaseboardNum).WaterMassFlowRate,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);

SetupOutputVariable(state,
"Baseboard Air Mass Flow Rate",
OutputProcessor::Unit::kg_s,
baseboard->Baseboard(BaseboardNum).AirMassFlowRate,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);

SetupOutputVariable(state,
"Baseboard Air Inlet Temperature",
OutputProcessor::Unit::C,
baseboard->Baseboard(BaseboardNum).AirInletTemp,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);

SetupOutputVariable(state,
"Baseboard Air Outlet Temperature",
OutputProcessor::Unit::C,
baseboard->Baseboard(BaseboardNum).AirOutletTemp,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);

SetupOutputVariable(state,
"Baseboard Water Inlet Temperature",
OutputProcessor::Unit::C,
baseboard->Baseboard(BaseboardNum).WaterInletTemp,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);

SetupOutputVariable(state,
"Baseboard Water Outlet Temperature",
OutputProcessor::Unit::C,
baseboard->Baseboard(BaseboardNum).WaterOutletTemp,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
baseboard->Baseboard(BaseboardNum).EquipID);
}
}
Expand Down
55 changes: 41 additions & 14 deletions src/EnergyPlus/BoilerSteam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,19 @@ namespace BoilerSteam {

void BoilerSpecs::setupOutputVars(EnergyPlusData &state)
{
SetupOutputVariable(state, "Boiler Heating Rate", OutputProcessor::Unit::W, this->BoilerLoad, "System", "Average", this->Name);
SetupOutputVariable(state,
"Boiler Heating Rate",
OutputProcessor::Unit::W,
this->BoilerLoad,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Heating Energy",
OutputProcessor::Unit::J,
this->BoilerEnergy,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
this->Name,
_,
"ENERGYTRANSFER",
Expand All @@ -461,28 +467,49 @@ namespace BoilerSteam {
"Boiler " + this->BoilerFuelTypeForOutputVariable + " Rate",
OutputProcessor::Unit::W,
this->FuelUsed,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler " + this->BoilerFuelTypeForOutputVariable + " Energy",
OutputProcessor::Unit::J,
this->FuelConsumed,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
this->Name,
_,
this->BoilerFuelTypeForOutputVariable,
"Heating",
this->EndUseSubcategory,
"Plant");
SetupOutputVariable(state, "Boiler Steam Efficiency", OutputProcessor::Unit::None, this->BoilerEff, "System", "Average", this->Name);
SetupOutputVariable(
state, "Boiler Steam Inlet Temperature", OutputProcessor::Unit::C, this->BoilerInletTemp, "System", "Average", this->Name);
SetupOutputVariable(
state, "Boiler Steam Outlet Temperature", OutputProcessor::Unit::C, this->BoilerOutletTemp, "System", "Average", this->Name);
SetupOutputVariable(
state, "Boiler Steam Mass Flow Rate", OutputProcessor::Unit::kg_s, this->BoilerMassFlowRate, "System", "Average", this->Name);
SetupOutputVariable(state,
"Boiler Steam Efficiency",
OutputProcessor::Unit::None,
this->BoilerEff,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Steam Inlet Temperature",
OutputProcessor::Unit::C,
this->BoilerInletTemp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Steam Outlet Temperature",
OutputProcessor::Unit::C,
this->BoilerOutletTemp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Steam Mass Flow Rate",
OutputProcessor::Unit::kg_s,
this->BoilerMassFlowRate,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
Copy link
Member Author

Choose a reason for hiding this comment

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

Some of the changes caused Clang Format to require line breaks.

}

void BoilerSpecs::autosize(EnergyPlusData &state)
Expand Down
73 changes: 57 additions & 16 deletions src/EnergyPlus/Boilers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,19 @@ void GetBoilerInput(EnergyPlusData &state)

void BoilerSpecs::SetupOutputVars(EnergyPlusData &state)
{
SetupOutputVariable(state, "Boiler Heating Rate", OutputProcessor::Unit::W, this->BoilerLoad, "System", "Average", this->Name);
SetupOutputVariable(state,
"Boiler Heating Rate",
OutputProcessor::Unit::W,
this->BoilerLoad,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Heating Energy",
OutputProcessor::Unit::J,
this->BoilerEnergy,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
this->Name,
_,
"ENERGYTRANSFER",
Expand All @@ -388,40 +394,75 @@ void BoilerSpecs::SetupOutputVars(EnergyPlusData &state)
"Boiler " + this->BoilerFuelTypeForOutputVariable + " Rate",
OutputProcessor::Unit::W,
this->FuelUsed,
"System",
"Average",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler " + this->BoilerFuelTypeForOutputVariable + " Energy",
OutputProcessor::Unit::J,
this->FuelConsumed,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
this->Name,
_,
this->BoilerFuelTypeForOutputVariable,
"Heating",
this->EndUseSubcategory,
"Plant");
SetupOutputVariable(state, "Boiler Inlet Temperature", OutputProcessor::Unit::C, this->BoilerInletTemp, "System", "Average", this->Name);
SetupOutputVariable(state, "Boiler Outlet Temperature", OutputProcessor::Unit::C, this->BoilerOutletTemp, "System", "Average", this->Name);
SetupOutputVariable(state, "Boiler Mass Flow Rate", OutputProcessor::Unit::kg_s, this->BoilerMassFlowRate, "System", "Average", this->Name);
SetupOutputVariable(
state, "Boiler Ancillary Electricity Rate", OutputProcessor::Unit::W, this->ParasiticElecPower, "System", "Average", this->Name);
SetupOutputVariable(state,
"Boiler Inlet Temperature",
OutputProcessor::Unit::C,
this->BoilerInletTemp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Outlet Temperature",
OutputProcessor::Unit::C,
this->BoilerOutletTemp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Mass Flow Rate",
OutputProcessor::Unit::kg_s,
this->BoilerMassFlowRate,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Ancillary Electricity Rate",
OutputProcessor::Unit::W,
this->ParasiticElecPower,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Ancillary Electricity Energy",
OutputProcessor::Unit::J,
this->ParasiticElecConsumption,
"System",
"Sum",
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
this->Name,
_,
"ELECTRICITY",
"Heating",
"Boiler Parasitic",
"Plant");
SetupOutputVariable(state, "Boiler Part Load Ratio", OutputProcessor::Unit::None, this->BoilerPLR, "System", "Average", this->Name);
SetupOutputVariable(state, "Boiler Efficiency", OutputProcessor::Unit::None, this->BoilerEff, "System", "Average", this->Name);
SetupOutputVariable(state,
"Boiler Part Load Ratio",
OutputProcessor::Unit::None,
this->BoilerPLR,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
SetupOutputVariable(state,
"Boiler Efficiency",
OutputProcessor::Unit::None,
this->BoilerEff,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->Name);
if (state.dataGlobal->AnyEnergyManagementSystemInModel) {
SetupEMSInternalVariable(state, "Boiler Nominal Capacity", this->Name, "[W]", this->NomCap);
}
Expand Down
Loading