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

Refactor RAFN CheckEquipName for forced air zone equipment #10452

Merged
merged 31 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b0db800
Upload a fix
lgu1234 Mar 28, 2024
c7628e5
Clang format
lgu1234 Mar 28, 2024
2925107
Different node names
lgu1234 Mar 28, 2024
ab7cdb4
Address comments
lgu1234 May 2, 2024
af44f1c
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 May 2, 2024
b989dc0
Clang format
lgu1234 May 2, 2024
73c79b2
Clang format
lgu1234 May 2, 2024
32d7e26
Correct a mistake
lgu1234 May 6, 2024
63ff34c
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 May 6, 2024
1698d9b
Add a test file with FanCoil and change code accordingly
lgu1234 May 29, 2024
264dc63
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 May 29, 2024
1d30477
Get correct index for unitary
lgu1234 May 29, 2024
097c9ed
Address further comments
lgu1234 May 30, 2024
2f7b39d
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 May 30, 2024
214ea1d
Add one more optional argument
lgu1234 May 30, 2024
0a71ac9
GetEqIndex for fan coil
lgu1234 May 30, 2024
f4a17a5
Solve an error
lgu1234 May 30, 2024
56d97c1
Create getEqIndex functions
lgu1234 Jun 5, 2024
2b368fb
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 Jun 5, 2024
a66cef8
Remove errFlag override
lgu1234 Jun 5, 2024
99729ec
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 Jun 5, 2024
4a1dc46
Clang format
lgu1234 Jun 5, 2024
40dc601
Cleanup
lgu1234 Jun 6, 2024
2b0f8cb
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 Jun 6, 2024
29905bd
Update WaterHeater:HeatPump type
lgu1234 Jun 10, 2024
0ee8b1f
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 Jun 10, 2024
01c2a82
Address comments and cleanup
lgu1234 Jul 10, 2024
4795a6c
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 Jul 10, 2024
0719aba
Revise GetIndex functions
lgu1234 Jul 15, 2024
60cdebb
Merge branch 'develop' into RAFN-CheckEquipName-Issue
lgu1234 Jul 15, 2024
5059ae9
Clang format
lgu1234 Jul 15, 2024
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
6 changes: 4 additions & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -21309,7 +21309,8 @@ RoomAir:Node:AirflowNetwork:HVACEquipment,
\key ZoneHVAC:IdealLoadsAirSystem
\key ZoneHVAC:RefrigerationChillerSet
\key Fan:ZoneExhaust
\key WaterHeater:HeatPump
\key WaterHeater:HeatPump:PumpedCondenser
\key WaterHeater:HeatPump:WrappedCondenser
\key AirTerminal:DualDuct:ConstantVolume
\key AirTerminal:DualDuct:VAV
\key AirTerminal:SingleDuct:ConstantVolume:Reheat
Expand Down Expand Up @@ -21359,7 +21360,8 @@ RoomAir:Node:AirflowNetwork:HVACEquipment,
\key ZoneHVAC:IdealLoadsAirSystem
\key ZoneHVAC:RefrigerationChillerSet
\key Fan:ZoneExhaust
\key WaterHeater:HeatPump
\key WaterHeater:HeatPump:PumpedCondenser
\key WaterHeater:HeatPump:WrappedCondenser
\key AirTerminal:DualDuct:ConstantVolume
\key AirTerminal:DualDuct:VAV
\key AirTerminal:SingleDuct:ConstantVolume:Reheat
Expand Down
17 changes: 17 additions & 0 deletions src/EnergyPlus/FanCoilUnits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4419,6 +4419,23 @@ namespace FanCoilUnits {
}
}

int getEqIndex(EnergyPlusData &state, std::string_view CompName)
{
if (state.dataFanCoilUnits->GetFanCoilInputFlag) {
GetFanCoilUnits(state);
state.dataFanCoilUnits->GetFanCoilInputFlag = false;
}

for (int FanCoilIndex = 1; FanCoilIndex <= state.dataFanCoilUnits->NumFanCoils; ++FanCoilIndex) {
auto &fanCoil = state.dataFanCoilUnits->FanCoil(FanCoilIndex);
if (Util::SameString(fanCoil.Name, CompName)) {
return FanCoilIndex;
}
}

return 0;
}

} // namespace FanCoilUnits

} // namespace EnergyPlus
3 changes: 2 additions & 1 deletion src/EnergyPlus/FanCoilUnits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ namespace FanCoilUnits {

void ReportFanCoilUnit(EnergyPlusData &state, int FanCoilNum); // number of the current fan coil unit being simulated

int GetFanCoilZoneInletAirNode(EnergyPlusData &state, int FanCoilNum);
int GetFanCoilZoneInletAirNode(EnergyPlusData &state, int const FanCoilNum);

int GetFanCoilOutAirNode(EnergyPlusData &state, int FanCoilNum);

Expand Down Expand Up @@ -380,6 +380,7 @@ namespace FanCoilUnits {
int WaterControlNode,
Real64 MinWaterFlow);

int getEqIndex(EnergyPlusData &state, std::string_view CompName);
} // namespace FanCoilUnits

struct FanCoilUnitsData : BaseGlobalStruct
Expand Down
16 changes: 16 additions & 0 deletions src/EnergyPlus/HVACStandAloneERV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1685,4 +1685,20 @@ bool GetStandAloneERVNodeNumber(EnergyPlusData &state, int const NodeNumber)
return false;
}

int getEqIndex(EnergyPlusData &state, std::string_view CompName)
{
if (state.dataHVACStandAloneERV->GetERVInputFlag) {
GetStandAloneERV(state);
state.dataHVACStandAloneERV->GetERVInputFlag = false;
}

for (int StandAloneERVNum = 1; StandAloneERVNum <= state.dataHVACStandAloneERV->NumStandAloneERVs; StandAloneERVNum++) {
if (Util::SameString(CompName, state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).Name)) {
return StandAloneERVNum;
break;
}
}
return 0;
}

} // namespace EnergyPlus::HVACStandAloneERV
2 changes: 2 additions & 0 deletions src/EnergyPlus/HVACStandAloneERV.hh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ namespace HVACStandAloneERV {

bool GetStandAloneERVNodeNumber(EnergyPlusData &state, int NodeNumber);

int getEqIndex(EnergyPlusData &state, std::string_view CompName);

} // namespace HVACStandAloneERV

struct HVACStandAloneERVData : BaseGlobalStruct
Expand Down
15 changes: 15 additions & 0 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10753,6 +10753,21 @@ int GetVRFTUReturnAirNode(EnergyPlusData &state, int const VRFTUNum)
}
}

int getEqIndex(EnergyPlusData &state, std::string_view VRFTUName)
{
if (state.dataHVACVarRefFlow->GetVRFInputFlag) {
GetVRFInput(state);
state.dataHVACVarRefFlow->GetVRFInputFlag = false;
}

for (int VRFTUNum = 1; VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU; VRFTUNum++) {
if (Util::SameString(VRFTUName, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).Name)) {
return VRFTUNum;
}
}
return 0;
}

void getVRFTUZoneLoad(
EnergyPlusData &state, int const VRFTUNum, Real64 &zoneLoad, Real64 &LoadToHeatingSP, Real64 &LoadToCoolingSP, bool const InitFlag)
{
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,8 @@ namespace HVACVariableRefrigerantFlow {
Real64 const T_suc // Compressor suction temperature Te' [C]
);

int getEqIndex(EnergyPlusData &state, std::string_view VRFTUName);

} // namespace HVACVariableRefrigerantFlow

struct HVACVarRefFlowData : BaseGlobalStruct
Expand Down
17 changes: 17 additions & 0 deletions src/EnergyPlus/HybridUnitaryAirConditioners.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,23 @@ int GetHybridUnitaryACReturnAirNode(EnergyPlusData &state, int const CompNum)
return GetHybridUnitaryACReturnAirNode;
}

int getHybridUnitaryACIndex(EnergyPlusData &state, std::string_view CompName)
{
bool errFlag = false;
if (state.dataHybridUnitaryAC->GetInputZoneHybridEvap) {
GetInputZoneHybridUnitaryAirConditioners(state, errFlag);
state.dataHybridUnitaryAC->GetInputZoneHybridEvap = false;
}

for (int UnitLoop = 1; UnitLoop <= state.dataHybridUnitaryAC->NumZoneHybridEvap; ++UnitLoop) {
if (Util::SameString(state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).Name, CompName)) {
return UnitLoop;
}
}

return 0;
}

//*****************************************************************************************

} // namespace EnergyPlus::HybridUnitaryAirConditioners
2 changes: 2 additions & 0 deletions src/EnergyPlus/HybridUnitaryAirConditioners.hh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ namespace HybridUnitaryAirConditioners {

int GetHybridUnitaryACReturnAirNode(EnergyPlusData &state, int UnitNum);

int getHybridUnitaryACIndex(EnergyPlusData &state, std::string_view CompName);

} // namespace HybridUnitaryAirConditioners

struct HybridUnitaryAirConditionersData : BaseGlobalStruct
Expand Down
16 changes: 16 additions & 0 deletions src/EnergyPlus/OutdoorAirUnit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2471,6 +2471,22 @@ namespace OutdoorAirUnit {
return GetOutdoorAirUnitReturnAirNode;
}

int getOutdoorAirUnitEqIndex(EnergyPlusData &state, std::string_view EquipName)
{
if (state.dataOutdoorAirUnit->GetOutdoorAirUnitInputFlag) {
OutdoorAirUnit::GetOutdoorAirUnitInputs(state);
state.dataOutdoorAirUnit->GetOutdoorAirUnitInputFlag = false;
}

for (int OAUnitNum = 1; OAUnitNum <= state.dataOutdoorAirUnit->NumOfOAUnits; ++OAUnitNum) {
if (Util::SameString(state.dataOutdoorAirUnit->OutAirUnit(OAUnitNum).Name, EquipName)) {
return OAUnitNum;
}
}

return 0;
}

} // namespace OutdoorAirUnit

} // namespace EnergyPlus
2 changes: 2 additions & 0 deletions src/EnergyPlus/OutdoorAirUnit.hh
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ namespace OutdoorAirUnit {
int GetOutdoorAirUnitZoneInletNode(EnergyPlusData &state, int OAUnitNum);

int GetOutdoorAirUnitReturnAirNode(EnergyPlusData &state, int OAUnitNum);

int getOutdoorAirUnitEqIndex(EnergyPlusData &state, std::string_view EquipName);
} // namespace OutdoorAirUnit

struct OutdoorAirUnitData : BaseGlobalStruct
Expand Down
16 changes: 16 additions & 0 deletions src/EnergyPlus/PurchasedAirManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3318,6 +3318,22 @@ int GetPurchasedAirReturnAirNode(EnergyPlusData &state, int const PurchAirNum)
return GetPurchasedAirReturnAirNode;
}

int getPurchasedAirIndex(EnergyPlusData &state, std::string_view PurchAirName)
{
if (state.dataPurchasedAirMgr->GetPurchAirInputFlag) {
GetPurchasedAir(state);
state.dataPurchasedAirMgr->GetPurchAirInputFlag = false;
}

for (int PurchAirNum = 1; PurchAirNum <= state.dataPurchasedAirMgr->NumPurchAir; ++PurchAirNum) {
if (Util::SameString(state.dataPurchasedAirMgr->PurchAir(PurchAirNum).Name, PurchAirName)) {
return PurchAirNum;
}
}

return 0;
}

Real64 GetPurchasedAirMixedAirTemp(EnergyPlusData &state, int const PurchAirNum)
{

Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/PurchasedAirManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ namespace PurchasedAirManager {

int GetPurchasedAirReturnAirNode(EnergyPlusData &state, int PurchAirNum);

int getPurchasedAirIndex(EnergyPlusData &state, std::string_view PurchAirName);

Real64 GetPurchasedAirMixedAirTemp(EnergyPlusData &state, int PurchAirNum);

Real64 GetPurchasedAirMixedAirHumRat(EnergyPlusData &state, int PurchAirNum);
Expand Down
Loading
Loading