Skip to content

Commit

Permalink
Merge pull request #8437 from energy-plus/global-state-simAirServingZ…
Browse files Browse the repository at this point in the history
…ones

Global SimAirServingZones
  • Loading branch information
mitchute authored Jan 5, 2021
2 parents d48c555 + de80181 commit deee526
Show file tree
Hide file tree
Showing 55 changed files with 10,309 additions and 10,926 deletions.
17 changes: 7 additions & 10 deletions src/EnergyPlus/CostEstimateManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ namespace CostEstimateManager {
using DataPhotovoltaics::iSimplePVModel;
using DataPhotovoltaics::PVarray;
using DataSurfaces::Surface;
using DXCoils::DXCoil;
using HeatingCoils::HeatingCoil;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Expand Down Expand Up @@ -309,7 +308,7 @@ namespace CostEstimateManager {
ErrorsFound = true;

} else { // assume name is probably useful
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, DXCoil);
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataDXCoils->DXCoil);
if (thisCoil == 0) {
ShowWarningError(state, "ComponentCost:LineItem: \"" + state.dataCostEstimateManager->CostLineItem(Item).LineName + "\", Coil:DX, invalid coil specified");
ShowContinueError(state, "Coil Specified=\"" + state.dataCostEstimateManager->CostLineItem(Item).ParentObjName +
Expand Down Expand Up @@ -497,8 +496,6 @@ namespace CostEstimateManager {
using DataPhotovoltaics::PVarray;
using DataSurfaces::Surface;
using DataSurfaces::TotSurfaces;
using DXCoils::DXCoil;
using DXCoils::NumDXCoils;
using HeatingCoils::HeatingCoil;
using HeatingCoils::NumHeatingCoils;

Expand Down Expand Up @@ -574,29 +571,29 @@ 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, DXCoil);
thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataDXCoils->DXCoil);
}

if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap > 0.0) {
if (WildcardObjNames) {
Real64 Qty(0.0);
for (auto const &e : DXCoil)
for (auto const &e : state.dataDXCoils->DXCoil)
Qty += e.RatedTotCap(1);
state.dataCostEstimateManager->CostLineItem(Item).Qty = Qty / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW (tot cool 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 = DXCoil(thisCoil).RatedTotCap(1) / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataDXCoils->DXCoil(thisCoil).RatedTotCap(1) / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW (tot cool 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 = double(NumDXCoils);
if (WildcardObjNames) state.dataCostEstimateManager->CostLineItem(Item).Qty = double(state.dataDXCoils->NumDXCoils);
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 @@ -606,15 +603,15 @@ namespace CostEstimateManager {
if (state.dataCostEstimateManager->CostLineItem(Item).PerKWCapPerCOP > 0.0) {
if (WildcardObjNames) {
Real64 Qty(0.0);
for (auto const &e : DXCoil)
for (auto const &e : state.dataDXCoils->DXCoil)
Qty += e.RatedCOP(1) * e.RatedTotCap(1);
state.dataCostEstimateManager->CostLineItem(Item).Qty = Qty / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW*COP (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 = DXCoil(thisCoil).RatedCOP(1) * DXCoil(thisCoil).RatedTotCap(1) / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataDXCoils->DXCoil(thisCoil).RatedCOP(1) * state.dataDXCoils->DXCoil(thisCoil).RatedTotCap(1) / 1000.0;
state.dataCostEstimateManager->CostLineItem(Item).Units = "kW*COP (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
Loading

5 comments on commit deee526

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

develop (mitchute) - x86_64-MacOS-10.15-clang-11.0.0: OK (2274 of 2274 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2294 of 2294 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

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

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (mitchute) - Win64-Windows-10-VisualStudio-16: OK (2246 of 2247 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1091
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

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

Build Badge Test Badge Coverage Badge

Please sign in to comment.