Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
52503e8
Initial commit
Apr 11, 2026
1ddc567
Fix some unit tests
Apr 11, 2026
1ca4b76
Fix first issue
Apr 15, 2026
d9ad532
Forgot to add/commit .hh file
Apr 16, 2026
c59795d
Fix a few more issues
Apr 17, 2026
cf33963
Fix more unit tests
Apr 18, 2026
dc338d5
Fix more unit tests
Apr 18, 2026
0a5070f
Fix yet more unit tests
Apr 19, 2026
4260454
Fix still more unit tests
Apr 22, 2026
9fc6e17
Forgot to add a file
Apr 22, 2026
abb2299
Merge develop, fix more unit tests
Apr 25, 2026
8507a61
Fix a few more unit tests
Apr 26, 2026
e11d842
Fix EnergyPlusFixture.AirflowNetwork_TestFanModel
jasondegraw May 11, 2026
3554729
Fix AirflowNetwork_UserDefinedDuctViewFactors
jasondegraw May 11, 2026
8d28919
Fix the AFN duct sizing test
jasondegraw May 12, 2026
3738b27
Possible fix of final AFN test
jasondegraw May 13, 2026
7652af7
Fix? 3 of 4 unit tests
rraustad Jun 18, 2026
09e445d
Fix more unit tests
rraustad Jun 18, 2026
d27b11e
Of course the coil was already read in init_state
rraustad Jun 18, 2026
89a5c56
Merge branch 'develop' of https://github.com/NatLabRockies/EnergyPlus…
rraustad Jun 18, 2026
dcb8b45
Fix more unit tests, all unit tests pass locally
rraustad Jun 19, 2026
c75d9e1
Merge branch 'develop' into CoilAPI2
mitchute Jun 22, 2026
f06cd9f
format
mitchute Jun 22, 2026
28bdcb3
Merge branch 'develop' into CoilAPI2
mitchute Jul 2, 2026
36a3756
pull meter resizing into a function so it can be reused, so we don't …
mitchute Jul 2, 2026
13b803c
Merge branch 'develop' into CoilAPI2
mitchute Jul 2, 2026
1021a14
hack to let init_state happen before the branches have been setup
mitchute Jul 2, 2026
67efbe4
Revert "hack to let init_state happen before the branches have been s…
mitchute Jul 2, 2026
22e7b66
more fun with branch initialization
mitchute Jul 2, 2026
a0ee495
some work to let coil be read in before the branch inputs have been c…
mitchute Jul 3, 2026
7a26972
another setup patch
mitchute Jul 5, 2026
063c08b
a few more cleanups
mitchute Jul 6, 2026
1a95bb0
patch tests to use a helper function to clear the state and reattache…
mitchute Jul 6, 2026
aee7a8b
add a few comments
mitchute Jul 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12705,6 +12705,7 @@ namespace AirflowNetwork {
DuctSizingSBFlag = true;
}
while (NodeNum1 != NodeSplitter) {
bool foundNextDuct = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added this boolean as part of a trapdoor to prevent an infinite loop failure. This came up in one of the failing unit tests, it then failed more normally, but the approach itself is risky.

for (AFNLinkNum1 = 1; AFNLinkNum1 <= AirflowNetworkNumOfLinks; AFNLinkNum1++) {
if (NodeNum1 != AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[0]) {
continue;
Expand All @@ -12724,10 +12725,14 @@ namespace AirflowNetwork {
DynamicLoss += disSysCompDuct.TurDynCoef;
NodeNum1 = AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[1];
DuctSizingSTFlag = true;
foundNextDuct = true;
break;
}
}
}
if (!foundNextDuct) {
break;
}
}
}
if (DuctSizingSTFlag) {
Expand Down Expand Up @@ -12828,6 +12833,7 @@ namespace AirflowNetwork {
DuctSizingSBFlag = true;
}
while (NodeNum1 != NodeSplitter) {
bool foundNextDuct = false;
for (AFNLinkNum1 = 1; AFNLinkNum1 <= AirflowNetworkNumOfLinks; AFNLinkNum1++) {
if (NodeNum1 != AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[1]) {
continue;
Expand All @@ -12847,10 +12853,14 @@ namespace AirflowNetwork {
DynamicLoss += disSysCompDuct.TurDynCoef;
NodeNum1 = AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[0];
DuctSizingSBFlag = true;
foundNextDuct = true;
break;
}
}
}
if (!foundNextDuct) {
break;
}
}
}
if (DuctSizingSBFlag) {
Expand Down Expand Up @@ -12955,6 +12965,7 @@ namespace AirflowNetwork {
DuctSizingRTFlag = true;
}
while (NodeNum1 != NodeMixer) {
bool foundNextDuct = false;
for (AFNLinkNum1 = 1; AFNLinkNum1 <= AirflowNetworkNumOfLinks; AFNLinkNum1++) {
if (NodeNum1 != AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[1]) {
continue;
Expand All @@ -12974,10 +12985,14 @@ namespace AirflowNetwork {
DynamicLoss += disSysCompDuct.TurDynCoef;
NodeNum1 = AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[0];
DuctSizingRTFlag = true;
foundNextDuct = true;
break;
}
}
}
if (!foundNextDuct) {
break;
}
}
}
if (DuctSizingRTFlag) {
Expand Down Expand Up @@ -13080,6 +13095,7 @@ namespace AirflowNetwork {
DuctSizingRBFlag = true;
}
while (NodeNum1 != NodeMixer) {
bool foundNextDuct = false;
for (AFNLinkNum1 = 1; AFNLinkNum1 <= AirflowNetworkNumOfLinks; AFNLinkNum1++) {
if (NodeNum1 != AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[0]) {
continue;
Expand All @@ -13099,10 +13115,14 @@ namespace AirflowNetwork {
DynamicLoss += disSysCompDuct.TurDynCoef;
NodeNum1 = AirflowNetworkLinkageData(AFNLinkNum1).NodeNums[1];
DuctSizingRBFlag = true;
foundNextDuct = true;
break;
}
}
}
if (!foundNextDuct) {
break;
}
}
}
if (DuctSizingRBFlag) {
Expand Down
7 changes: 4 additions & 3 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ std::shared_ptr<CoilCoolingDXPerformanceBase> CoilCoolingDX::makePerformanceSubc

int CoilCoolingDX::factory(EnergyPlus::EnergyPlusData &state, std::string const &coilName)
{
if (state.dataCoilCoolingDX->coilCoolingDXGetInputFlag) {
if (state.dataCoilCoolingDX->GetInputFlag) {
CoilCoolingDX::getInput(state);
state.dataCoilCoolingDX->coilCoolingDXGetInputFlag = false;
state.dataCoilCoolingDX->GetInputFlag = false;
}
int handle = -1;
std::string coilNameUpper = Util::makeUPPER(coilName);
Expand All @@ -115,10 +115,11 @@ int CoilCoolingDX::factory(EnergyPlus::EnergyPlusData &state, std::string const

void CoilCoolingDX::getInput(EnergyPlusData &state)
{

auto *inputProcessor = state.dataInputProcessing->inputProcessor.get();
auto const coilInstances = inputProcessor->epJSON.find(state.dataCoilCoolingDX->coilCoolingDXObjectName);
if (coilInstances == inputProcessor->epJSON.end() || coilInstances->empty()) {
ShowFatalError(state, R"(No "Coil:Cooling:DX" objects in input file)");
return; // Was fatal error
}
auto const &coilSchemaProps = inputProcessor->getObjectSchemaProps(state, state.dataCoilCoolingDX->coilCoolingDXObjectName);

Expand Down
10 changes: 7 additions & 3 deletions src/EnergyPlus/Coils/CoilCoolingDX.hh
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,28 @@ private:
struct CoilCoolingDXData : BaseGlobalStruct
{
std::vector<CoilCoolingDX> coilCoolingDXs;
bool coilCoolingDXGetInputFlag = true;
std::string const coilCoolingDXObjectName = "Coil:Cooling:DX";
HVAC::CoilType coilType = HVAC::CoilType::CoolingDX;
bool stillNeedToReportStandardRatings = true; // standard ratings flag for all coils to report at the same time

bool GetInputFlag = true;

void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
{
}

void init_state([[maybe_unused]] EnergyPlusData &state) override
{
if (this->GetInputFlag) {
CoilCoolingDX::getInput(state);
this->GetInputFlag = false;
}
}

void clear_state() override
{
coilCoolingDXs.clear();
coilCoolingDXGetInputFlag = true;
stillNeedToReportStandardRatings = true;
GetInputFlag = true;
}
};

Expand Down
Loading
Loading