Skip to content

Commit

Permalink
Move an object array
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondegraw committed Dec 30, 2020
1 parent 8bb529d commit f6ae40d
Show file tree
Hide file tree
Showing 11 changed files with 463 additions and 415 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ namespace AirflowNetwork {
// = NumOfLinksMultiZone+NumOfLinksDistribution
// RoomAirManager use
//extern int AirflowNetworkNumOfSurfaces; // The number of surfaces for multizone calculation
extern int AirflowNetworkNumOfZones; // The number of zones for multizone calculation
//extern int AirflowNetworkNumOfZones; // The number of zones for multizone calculation

extern bool RollBackFlag; // Roll back flag when system time step down shifting
extern Array1D<Real64> ANZT; // Local zone air temperature for roll back use
Expand Down Expand Up @@ -1637,7 +1637,7 @@ namespace AirflowNetwork {

// Object Data
extern Array1D<AirflowNetworkNodeSimuData> AirflowNetworkNodeSimu;
extern Array1D<AirflowNetworkLinkSimuData> AirflowNetworkLinkSimu;
//extern Array1D<AirflowNetworkLinkSimuData> AirflowNetworkLinkSimu;

extern AirflowNetworkSimuProp AirflowNetworkSimu;
// unique object name | AirflowNetwork control | Wind pressure coefficient input control | Integer equivalent for WPCCntr
Expand Down
8 changes: 4 additions & 4 deletions src/EnergyPlus/AirflowNetwork/src/Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace AirflowNetwork {
// = NumOfLinksMultiZone+NumOfLinksDistribution
// RoomAirManager use
//int AirflowNetworkNumOfSurfaces(0); // The number of surfaces for multizone calculation
int AirflowNetworkNumOfZones(0); // The number of zones for multizone calculation
//int AirflowNetworkNumOfZones(0); // The number of zones for multizone calculation

bool RollBackFlag(false); // Roll back flag when system time step down shifting
Array1D<Real64> ANZT; // Local zone air temperature for roll back use
Expand All @@ -188,7 +188,7 @@ namespace AirflowNetwork {

// Object Data
Array1D<AirflowNetworkNodeSimuData> AirflowNetworkNodeSimu;
Array1D<AirflowNetworkLinkSimuData> AirflowNetworkLinkSimu;
//Array1D<AirflowNetworkLinkSimuData> AirflowNetworkLinkSimu;
//Array1D<AirflowNetworkExchangeProp> AirflowNetworkExchangeData;
//Array1D<AirflowNetworkExchangeProp> AirflowNetworkMultiExchangeData;
//Array1D<AirflowNetworkLinkReportData> AirflowNetworkLinkReport;
Expand Down Expand Up @@ -3837,7 +3837,7 @@ namespace AirflowNetwork {
AirflowNetworkNumOfComps = 0;
AirflowNetworkNumOfLinks = 0;
//AirflowNetworkNumOfSurfaces = 0;
AirflowNetworkNumOfZones = 0;
//AirflowNetworkNumOfZones = 0;
RollBackFlag = false;
ANZT.deallocate();
ANZW.deallocate();
Expand All @@ -3851,7 +3851,7 @@ namespace AirflowNetwork {
VAVTerminalRatio = 0.0;
VAVSystem = false;
AirflowNetworkNodeSimu.deallocate();
AirflowNetworkLinkSimu.deallocate();
//AirflowNetworkLinkSimu.deallocate();
//AirflowNetworkExchangeData.deallocate();
//AirflowNetworkMultiExchangeData.deallocate();
//AirflowNetworkLinkReport.deallocate();
Expand Down
31 changes: 16 additions & 15 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <EnergyPlus/DataEnvironment.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataSurfaces.hh>
#include <EnergyPlus/AirflowNetworkBalanceManager.hh>

#include "../../Data/EnergyPlusData.hh"

Expand Down Expand Up @@ -569,34 +570,34 @@ namespace AirflowNetwork {
if (AFLOW2(i) != 0.0) {
}
if (AFLOW(i) > 0.0) {
AirflowNetworkLinkSimu(i).FLOW = AFLOW(i);
AirflowNetworkLinkSimu(i).FLOW2 = 0.0;
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = AFLOW(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = 0.0;
} else {
AirflowNetworkLinkSimu(i).FLOW = 0.0;
AirflowNetworkLinkSimu(i).FLOW2 = -AFLOW(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = 0.0;
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = -AFLOW(i);
}
if (AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).CompTypeNum == CompTypeNum_HOP) {
if (AFLOW(i) > 0.0) {
AirflowNetworkLinkSimu(i).FLOW = AFLOW(i) + AFLOW2(i);
AirflowNetworkLinkSimu(i).FLOW2 = AFLOW2(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = AFLOW(i) + AFLOW2(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = AFLOW2(i);
} else {
AirflowNetworkLinkSimu(i).FLOW = AFLOW2(i);
AirflowNetworkLinkSimu(i).FLOW2 = -AFLOW(i) + AFLOW2(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = AFLOW2(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = -AFLOW(i) + AFLOW2(i);
}
}
if (AirflowNetworkLinkageData(i).DetOpenNum > 0) {
if (AFLOW2(i) != 0.0) {
AirflowNetworkLinkSimu(i).FLOW = AFLOW(i) + AFLOW2(i);
AirflowNetworkLinkSimu(i).FLOW2 = AFLOW2(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = AFLOW(i) + AFLOW2(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = AFLOW2(i);
}
}
if (AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).CompTypeNum == CompTypeNum_SOP && AFLOW2(i) != 0.0) {
if (AFLOW(i) >= 0.0) {
AirflowNetworkLinkSimu(i).FLOW = AFLOW(i);
AirflowNetworkLinkSimu(i).FLOW2 = std::abs(AFLOW2(i));
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = AFLOW(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = std::abs(AFLOW2(i));
} else {
AirflowNetworkLinkSimu(i).FLOW = std::abs(AFLOW2(i));
AirflowNetworkLinkSimu(i).FLOW2 = -AFLOW(i);
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW = std::abs(AFLOW2(i));
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).FLOW2 = -AFLOW(i);
}
}
}
Expand Down Expand Up @@ -913,7 +914,7 @@ namespace AirflowNetwork {
DP = DisSysCompCPDData(AirflowNetworkCompData(j).TypeNum).DP;
}

AirflowNetworkLinkSimu(i).DP = DP;
state.dataAirflowNetworkBalanceManager->AirflowNetworkLinkSimu(i).DP = DP;
AFLOW(i) = F[0];
AFLOW2(i) = 0.0;
if (AirflowNetworkCompData(j).CompTypeNum == CompTypeNum_DOP) {
Expand Down
Loading

5 comments on commit f6ae40d

@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.

afn-repairs (jasondegraw) - x86_64-MacOS-10.15-clang-11.0.0: OK (2990 of 2990 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.

afn-repairs (jasondegraw) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3030 of 3030 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

afn-repairs (jasondegraw) - 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-2
Copy link

Choose a reason for hiding this comment

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

afn-repairs (jasondegraw) - 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

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

afn-repairs (jasondegraw) - Win64-Windows-10-VisualStudio-16: OK (2247 of 2247 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.