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

Global HeatingCoils, DualDuct, DataPhotovoltaics & Fix #8635 #8637

Merged
merged 14 commits into from
Mar 21, 2021
1 change: 0 additions & 1 deletion src/EnergyPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ set(SRC
DataMoistureBalanceEMPD.hh
DataOutputs.cc
DataOutputs.hh
DataPhotovoltaics.cc
DataPhotovoltaics.hh
DataPrecisionGlobals.hh
DataReportingFlags.hh
Expand Down
47 changes: 22 additions & 25 deletions src/EnergyPlus/CostEstimateManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,6 @@ namespace CostEstimateManager {
// PURPOSE OF THIS SUBROUTINE:
// Calculates the Cost Estimate based on inputs.

// Using/Aliasing
using DataPhotovoltaics::iSimplePVModel;
using DataPhotovoltaics::PVarray;
using HeatingCoils::HeatingCoil;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int Item; // do-loop counter for line items
int ThisConstructID; // hold result of FindItem searching for Construct name
Expand Down Expand Up @@ -341,7 +336,8 @@ namespace CostEstimateManager {
ErrorsFound = true;

} else { // assume name is probably useful
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, HeatingCoil);
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName,
state.dataHeatingCoils->HeatingCoil);
if (thisCoil == 0) {
ShowWarningError(state, "ComponentCost:LineItem: \"" + state.dataCostEstimateManager->CostLineItem(Item).LineName +
"\", Coil:Heating:Fuel, invalid coil specified");
Expand Down Expand Up @@ -441,9 +437,9 @@ namespace CostEstimateManager {

if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap != 0.0) {
if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) {
thisPV = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, PVarray);
thisPV = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataPhotovoltaic->PVarray);
if (thisPV > 0) {
if (PVarray(thisPV).PVModelType != iSimplePVModel) {
if (state.dataPhotovoltaic->PVarray(thisPV).PVModelType != DataPhotovoltaics::PVModel::Simple) {
ShowSevereError(state, "ComponentCost:LineItem: \"" + state.dataCostEstimateManager->CostLineItem(Item).LineName +
"\", Generator:Photovoltaic, only available for model type PhotovoltaicPerformance:Simple");
ErrorsFound = true;
Expand Down Expand Up @@ -487,12 +483,6 @@ namespace CostEstimateManager {
// PURPOSE OF THIS SUBROUTINE:
// Calculates the Cost Estimate based on inputs.

// Using/Aliasing
using DataPhotovoltaics::iSimplePVModel;
using DataPhotovoltaics::PVarray;
using HeatingCoils::HeatingCoil;
using HeatingCoils::NumHeatingCoils;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int Item; // do-loop counter for line items
int ThisConstructID; // hold result of FindItem searching for Construct name
Expand Down Expand Up @@ -620,29 +610,31 @@ namespace CostEstimateManager {
if (state.dataCostEstimateManager->CostLineItem(Item).ParentObjName == "*") { // wildcard, apply to all such components
WildcardObjNames = true;
} else if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) {
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, HeatingCoil);
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName,
state.dataHeatingCoils->HeatingCoil);
}

if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap > 0.0) {
if (WildcardObjNames) {
Real64 Qty(0.0);
for (auto const &e : HeatingCoil)
for (auto const &e : state.dataHeatingCoils->HeatingCoil)
if (e.HCoilType_Num == 1) Qty += e.NominalCapacity;
state.dataCostEstimateManager->CostLineItem(Item).Qty = Qty / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW (tot heat cap.)";
state.dataCostEstimateManager->CostLineItem(Item).ValuePer = state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap;
state.dataCostEstimateManager->CostLineItem(Item).LineSubTotal = state.dataCostEstimateManager->CostLineItem(Item).Qty * state.dataCostEstimateManager->CostLineItem(Item).ValuePer;
}
if (thisCoil > 0) {
state.dataCostEstimateManager->CostLineItem(Item).Qty = HeatingCoil(thisCoil).NominalCapacity / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Qty =
state.dataHeatingCoils->HeatingCoil(thisCoil).NominalCapacity / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW (tot heat cap.)";
state.dataCostEstimateManager->CostLineItem(Item).ValuePer = state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap;
state.dataCostEstimateManager->CostLineItem(Item).LineSubTotal = state.dataCostEstimateManager->CostLineItem(Item).Qty * state.dataCostEstimateManager->CostLineItem(Item).ValuePer;
}
}

if (state.dataCostEstimateManager->CostLineItem(Item).PerEach > 0.0) {
if (WildcardObjNames) state.dataCostEstimateManager->CostLineItem(Item).Qty = NumHeatingCoils;
if (WildcardObjNames) state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataHeatingCoils->NumHeatingCoils;
if (thisCoil > 0) state.dataCostEstimateManager->CostLineItem(Item).Qty = 1.0;
state.dataCostEstimateManager->CostLineItem(Item).ValuePer = state.dataCostEstimateManager->CostLineItem(Item).PerEach;
state.dataCostEstimateManager->CostLineItem(Item).LineSubTotal = state.dataCostEstimateManager->CostLineItem(Item).Qty * state.dataCostEstimateManager->CostLineItem(Item).ValuePer;
Expand All @@ -652,15 +644,17 @@ namespace CostEstimateManager {
if (state.dataCostEstimateManager->CostLineItem(Item).PerKWCapPerCOP > 0.0) {
if (WildcardObjNames) {
Real64 Qty(0.0);
for (auto const &e : HeatingCoil)
for (auto const &e : state.dataHeatingCoils->HeatingCoil)
if (e.HCoilType_Num == 1) Qty += e.Efficiency * e.NominalCapacity;
state.dataCostEstimateManager->CostLineItem(Item).Qty = Qty / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW*Eff (total, rated) ";
state.dataCostEstimateManager->CostLineItem(Item).ValuePer = state.dataCostEstimateManager->CostLineItem(Item).PerKWCapPerCOP;
state.dataCostEstimateManager->CostLineItem(Item).LineSubTotal = state.dataCostEstimateManager->CostLineItem(Item).Qty * state.dataCostEstimateManager->CostLineItem(Item).ValuePer;
}
if (thisCoil > 0) {
state.dataCostEstimateManager->CostLineItem(Item).Qty = HeatingCoil(thisCoil).Efficiency * HeatingCoil(thisCoil).NominalCapacity / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataHeatingCoils->HeatingCoil(thisCoil).Efficiency *
state.dataHeatingCoils->HeatingCoil(thisCoil).NominalCapacity /
1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW*Eff (total, rated) ";
state.dataCostEstimateManager->CostLineItem(Item).ValuePer = state.dataCostEstimateManager->CostLineItem(Item).PerKWCapPerCOP;
state.dataCostEstimateManager->CostLineItem(Item).LineSubTotal = state.dataCostEstimateManager->CostLineItem(Item).Qty * state.dataCostEstimateManager->CostLineItem(Item).ValuePer;
Expand Down Expand Up @@ -753,17 +747,20 @@ namespace CostEstimateManager {

if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap != 0.0) {
if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) {
thisPV = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, PVarray);
thisPV = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName,
state.dataPhotovoltaic->PVarray);
if (thisPV > 0) {
ThisZoneID = UtilityRoutines::FindItem(state.dataSurface->Surface(PVarray(thisPV).SurfacePtr).ZoneName, Zone);
ThisZoneID = UtilityRoutines::FindItem(
state.dataSurface->Surface(state.dataPhotovoltaic->PVarray(thisPV).SurfacePtr).ZoneName, Zone);
if (ThisZoneID == 0) {
Multipliers = 1.0;
} else {
Multipliers = Zone(ThisZoneID).Multiplier * Zone(ThisZoneID).ListMultiplier;
}
if (PVarray(thisPV).PVModelType == iSimplePVModel) {
state.dataCostEstimateManager->CostLineItem(Item).Qty = 1000.0 * PVarray(thisPV).SimplePVModule.AreaCol *
PVarray(thisPV).SimplePVModule.PVEfficiency * Multipliers / 1000.0;
if (state.dataPhotovoltaic->PVarray(thisPV).PVModelType == DataPhotovoltaics::PVModel::Simple) {
state.dataCostEstimateManager->CostLineItem(Item).Qty =
1000.0 * state.dataPhotovoltaic->PVarray(thisPV).SimplePVModule.AreaCol *
state.dataPhotovoltaic->PVarray(thisPV).SimplePVModule.PVEfficiency * Multipliers / 1000.0;
}
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW (rated)";
state.dataCostEstimateManager->CostLineItem(Item).ValuePer = state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap;
Expand Down
146 changes: 0 additions & 146 deletions src/EnergyPlus/DataPhotovoltaics.cc

This file was deleted.

Loading