Skip to content
Open

Coil API #11004

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8d6a2db
Partial (non-compiling) commit
Jan 9, 2025
23a2871
Merge remote-tracking branch 'origin/develop' into CoilType
Jan 9, 2025
80e6dee
Partial non-working commit for develop merge purposes
Jan 23, 2025
11f623c
Successful build commit in prep for merging develop
Feb 12, 2025
353083c
Fix some unit tests
Mar 18, 2025
536c1fd
Merge develop; fix some unit tests
Mar 20, 2025
759f65e
Fix more unit tests
Mar 21, 2025
fabbe41
Merge remote-tracking branch 'origin/develop' into CoilType
Mar 21, 2025
3868b92
Fix integration tests
Mar 22, 2025
648c2c1
Merge develop; fix a few integration/regression issues
Mar 27, 2025
18cbba2
Fix one regression issue and minor cleanup
Mar 28, 2025
7d05580
Fix another regression issue
Mar 28, 2025
12ddab2
Fix issue with autosized water coil showing User-Specified and crash …
rraustad Mar 29, 2025
c9b7120
Fix several diffs
rraustad Mar 30, 2025
7c2af2e
Update ATMixer condition only when mass flow > 0
rraustad Mar 30, 2025
4a72240
Fix HXAssisted control issue with new DX coil model
rraustad Mar 31, 2025
660c666
Small changes
Apr 10, 2025
8e52218
merge develop; resolve conflicts (except for HVACVRF)
Apr 11, 2025
2827f24
Reimplement VRF changes
Apr 11, 2025
e26aa0f
Merge develop, resolve conflicts
May 16, 2025
8da63cf
Fix one issue, and one hypothetical (by inspection) issue
May 17, 2025
919793d
Don't remember what this was trying to fix
Jul 27, 2025
12c12dd
Merge develop; resolve conflicts
Oct 10, 2025
9638f41
Merged develop; resolved conflicts
Oct 28, 2025
38a2013
merge develop; resolve conflicts (not for the last time)
Feb 7, 2026
0a3da0e
Merge develop; resolve conflicts
Feb 14, 2026
4597016
Fix DXCoils issue
Feb 14, 2026
d520fa4
Address compiler warnings
Feb 14, 2026
fc71948
Address compilation issue
Feb 15, 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
238 changes: 135 additions & 103 deletions src/EnergyPlus/AirLoopHVACDOAS.cc

Large diffs are not rendered by default.

47 changes: 13 additions & 34 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ namespace AirflowNetwork {
DisSysCompHXData(i).EPlusType = hx_type; // coil type
DisSysCompHXData(i).L = L; // Air path length
DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter
DisSysCompHXData(i).CoilParentExists = HVACHXAssistedCoolingCoil::VerifyHeatExchangerParent(m_state, hx_type, hx_name);
DisSysCompHXData(i).CoilParentExists = HXAssistCoil::VerifyHeatExchangerParent(m_state, hx_type, hx_name);

// Add the element to the lookup table, check for name overlaps
if (elements.find(DisSysCompHXData(i).name) == elements.end()) {
Expand Down Expand Up @@ -1642,7 +1642,7 @@ namespace AirflowNetwork {
// Using/Aliasing
using Curve::GetCurveIndex;
using DataLoopNode::ObjectIsParent;
using HVACHXAssistedCoolingCoil::VerifyHeatExchangerParent;
using HXAssistCoil::VerifyHeatExchangerParent;
using MixedAir::GetOAMixerNumber;
using NodeInputManager::GetOnlySingleNode;
using OutAirNodeManager::SetOutAirNodes;
Expand Down Expand Up @@ -10342,7 +10342,6 @@ namespace AirflowNetwork {
using namespace DataLoopNode;
auto &NumPrimaryAirSys = m_state.dataHVACGlobal->NumPrimaryAirSys;
using DXCoils::SetDXCoilAirLoopNumber;
using HeatingCoils::SetHeatingCoilAirLoopNumber;
using HVACStandAloneERV::GetStandAloneERVNodeNumber;
using HVACVariableRefrigerantFlow::getVRFTUNodeNumber;
using SplitterComponent::GetSplitterNodeNumbers;
Expand Down Expand Up @@ -10766,21 +10765,15 @@ namespace AirflowNetwork {
SetDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
}

} else if (SELECT_CASE_var == "COIL:HEATING:FUEL") {
ValidateComponent(m_state, "Coil:Heating:Fuel", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
if (IsNotOK) {
} else if (SELECT_CASE_var == "COIL:HEATING:FUEL" ||
SELECT_CASE_var == "COIL:HEATING:ELECTRIC" ||
SELECT_CASE_var == "COIL:HEATING:ELECTRIC:MULTISTAGE" ||
SELECT_CASE_var == "COIL:HEATING:GAS:MULTISTAGE") {
int coilNum = HeatingCoils::GetCoilIndex(m_state, DisSysCompCoilData(i).name);
if (coilNum == 0) {
ErrorsFound = true;
} else {
SetHeatingCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum, ErrorsFound);
}

} else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") {
ValidateComponent(
m_state, "Coil:Heating:Electric", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
if (IsNotOK) {
ErrorsFound = true;
} else {
SetHeatingCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum, ErrorsFound);
HeatingCoils::SetCoilAirLoopNumber(m_state, coilNum, DisSysCompCoilData(i).AirLoopNum);
}

} else if (SELECT_CASE_var == "COIL:COOLING:WATER") {
Expand Down Expand Up @@ -10844,7 +10837,8 @@ namespace AirflowNetwork {
if (IsNotOK) {
ErrorsFound = true;
} else {
SetVarSpeedDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
int coilNum = VariableSpeedCoils::GetCoilIndex(m_state, DisSysCompCoilData(i).name);
SetVarSpeedDXCoilAirLoopNumber(m_state, coilNum, DisSysCompCoilData(i).AirLoopNum);
}

} else if (SELECT_CASE_var == "COIL:HEATING:DX:VARIABLESPEED") {
Expand All @@ -10854,7 +10848,8 @@ namespace AirflowNetwork {
if (IsNotOK) {
ErrorsFound = true;
} else {
SetVarSpeedDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
int const coilNum = VariableSpeedCoils::GetCoilIndex(m_state, DisSysCompCoilData(i).name);
SetVarSpeedDXCoilAirLoopNumber(m_state, coilNum, DisSysCompCoilData(i).AirLoopNum);
}
} else if (SELECT_CASE_var == "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT") {
ValidateComponent(m_state,
Expand Down Expand Up @@ -10910,22 +10905,6 @@ namespace AirflowNetwork {
} else {
SetDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
}
} else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC:MULTISTAGE") {
ValidateComponent(
m_state, "Coil:Heating:Electric:MultiStage", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
if (IsNotOK) {
ErrorsFound = true;
} else {
SetHeatingCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum, ErrorsFound);
}
} else if (SELECT_CASE_var == "COIL:HEATING:GAS:MULTISTAGE") {
ValidateComponent(
m_state, "Coil:Heating:Gas:MultiStage", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
if (IsNotOK) {
ErrorsFound = true;
} else {
SetHeatingCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum, ErrorsFound);
}
} else {
ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " Invalid coil type = " + DisSysCompCoilData(i).name);
ErrorsFound = true;
Expand Down
16 changes: 6 additions & 10 deletions src/EnergyPlus/Autosizing/All_Simple_Sizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,8 @@ Real64 HeatingCoilDesAirInletTempSizer::size(EnergyPlusData &state, Real64 _orig
}
}
this->selectSizerOutput(state, errorsFound);
if (this->isCoilReportObject) {
state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(
state, this->compName, this->compType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum);
}
if (this->isCoilReportObject)
ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, this->autoSizedValue, this->curSysNum, this->curZoneEqNum);
return this->autoSizedValue;
}

Expand Down Expand Up @@ -348,9 +346,8 @@ Real64 HeatingCoilDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _ori
}
}
this->selectSizerOutput(state, errorsFound);
if (this->isCoilReportObject) {
state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, this->autoSizedValue);
}
if (this->isCoilReportObject)
ReportCoilSelection::setCoilLvgAirTemp(state, this->coilReportNum, this->autoSizedValue);
return this->autoSizedValue;
}

Expand Down Expand Up @@ -385,9 +382,8 @@ Real64 HeatingCoilDesAirInletHumRatSizer::size(EnergyPlusData &state, Real64 _or
}
}
this->selectSizerOutput(state, errorsFound);
if (this->isCoilReportObject) {
state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, this->autoSizedValue);
}
if (this->isCoilReportObject)
ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, this->autoSizedValue);
return this->autoSizedValue;
}

Expand Down
17 changes: 6 additions & 11 deletions src/EnergyPlus/Autosizing/Base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ void BaseSizer::initializeWithinEP(EnergyPlusData &state,
{
this->initialized = true;
this->compType = _compType;
// This is done during the isValidCoilType call. Why?
// this->coilType = static_cast<HVAC::CoilType>(getEnumValue(HVAC::coilTypeNamesUC, Util::makeUPPER(_compType)));
this->compName = _compName;
this->isEpJSON = state.dataGlobal->isEpJSON;
this->printWarningFlag = _printWarningFlag;
Expand Down Expand Up @@ -108,6 +110,7 @@ void BaseSizer::initializeWithinEP(EnergyPlusData &state,
this->airloopDOAS = state.dataAirLoopHVACDOAS->airloopDOAS;
if (EnergyPlus::BaseSizer::isValidCoilType(this->compType)) { // coil reports fail if compType is not one of HVAC::cAllCoilTypes
this->isCoilReportObject = true;
this->coilReportNum = ReportCoilSelection::getReportIndex(state, this->compName, this->coilType);
}
if (EnergyPlus::BaseSizer::isValidFanType(this->compType)) { // fan reports fail if compType is not a valid fan type
this->isFanReportObject = true;
Expand Down Expand Up @@ -607,16 +610,8 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro

bool BaseSizer::isValidCoilType(std::string const &_compType)
{
int coilNum = 0;
for (auto const &coilType : HVAC::cAllCoilTypes) {
coilNum += 1;
if (Util::SameString(_compType, coilType)) {
this->coilType_Num = coilNum;
return true;
}
}
this->coilType_Num = 0;
return false;
this->coilType = static_cast<HVAC::CoilType>(getEnumValue(HVAC::coilTypeNamesUC, Util::makeUPPER(_compType)));
return this->coilType != HVAC::CoilType::Invalid;
}

bool BaseSizer::isValidFanType(std::string const &_compType)
Expand Down Expand Up @@ -939,7 +934,7 @@ void BaseSizer::clearState()
sizingDesValueFromParent = false;
airLoopSysFlag = false;
oaSysFlag = false;
coilType_Num = 0;
coilType = HVAC::CoilType::Invalid;
compType = "";
compName = "";
isEpJSON = false;
Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/Autosizing/Base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct BaseSizer
bool dataScalableSizingON = false;
bool dataScalableCapSizingON = false;
bool isCoilReportObject = false; // provides access to coil reporting
int coilReportNum = -1; // Coil report index
bool isFanReportObject = false; // provides access to fan reporting
bool initialized = false; // indicates initializeWithinEP was called
AutoSizingResultType errorType = AutoSizingResultType::NoError;
Expand All @@ -139,11 +140,12 @@ struct BaseSizer
bool sizingDesValueFromParent = false;
bool airLoopSysFlag = false;
bool oaSysFlag = false;
int coilType_Num = 0;
HVAC::CoilType coilType = HVAC::CoilType::Invalid;
std::string compType;
std::string compName;
bool isEpJSON = false;


bool sysSizingRunDone = false;
bool zoneSizingRunDone = false;
int curSysNum = 0;
Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ void BaseSizerWithScalableInputs::initializeWithinEP(EnergyPlusData &state,

// This should work for both fan types
if (this->primaryAirSystem(this->curSysNum).supFanNum > 0) {
state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo(
ReportCoilSelection::setCoilSupplyFanInfo(
state,
this->compName,
this->compType,
this->coilReportNum,
state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->Name,
state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->type,
this->primaryAirSystem(this->curSysNum).supFanNum);
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct BaseSizerWithScalableInputs : BaseSizerWithFanHeatInputs
Real64 suppHeatCap = 0.0;
Real64 unitaryHeatCap = 0.0;
int dataTotCapCurveIndex = 0;
int dataCoolCoilType = -1;
HVAC::CoilType dataCoolCoilType = HVAC::CoilType::Invalid; // Why the 'data' prefix?
int dataCoolCoilIndex = -1;

int zoneHVACSizingIndex = 0;
Expand Down Expand Up @@ -125,7 +125,7 @@ struct BaseSizerWithScalableInputs : BaseSizerWithFanHeatInputs
suppHeatCap = 0.0;
unitaryHeatCap = 0.0;
zoneHVACSizingIndex = 0;
dataCoolCoilType = -1;
dataCoolCoilType = HVAC::CoilType::Invalid;
dataCoolCoilIndex = -1;
zoneHVACSizing.clear();
}
Expand Down
38 changes: 17 additions & 21 deletions src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,9 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b
if (this->overrideSizeString) {
if (Util::SameString(this->compType, "ZoneHVAC:FourPipeFanCoil")) {
this->sizingString = "Maximum Supply Air Flow Rate [m3/s]";
if (this->isEpJSON) {
if (this->isEpJSON)
this->sizingString = "maximum_supply_air_flow_rate [m3/s]";
}
} else if (this->coilType_Num == HVAC::CoilDX_CoolingTwoSpeed) {
} else if (this->coilType == HVAC::CoilType::CoolingDXTwoSpeed) {
if (this->dataDXSpeedNum == 1) { // mode 1 is high speed in DXCoils loop
if (this->isEpJSON) {
this->sizingString = "high_speed_rated_air_flow_rate [m3/s]";
Expand All @@ -357,18 +356,18 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b
this->sizingString = "cooling_supply_air_flow_rate [m3/s]";
}
}
if (this->dataScalableSizingON) {
if (this->zoneAirFlowSizMethod == DataSizing::SupplyAirFlowRate || this->zoneAirFlowSizMethod == DataSizing::None) {
this->sizingStringScalable = "(scaled by flow / zone) ";
} else if (this->zoneAirFlowSizMethod == DataSizing::FlowPerFloorArea) {
this->sizingStringScalable = "(scaled by flow / area) ";
} else if (this->zoneAirFlowSizMethod == DataSizing::FractionOfAutosizedCoolingAirflow ||
this->zoneAirFlowSizMethod == DataSizing::FractionOfAutosizedHeatingAirflow) {
this->sizingStringScalable = "(scaled by fractional multiplier) ";
} else if (this->zoneAirFlowSizMethod == DataSizing::FlowPerCoolingCapacity ||
this->zoneAirFlowSizMethod == DataSizing::FlowPerHeatingCapacity) {
this->sizingStringScalable = "(scaled by flow / capacity) ";
}
}
if (this->dataScalableSizingON) {
if (this->zoneAirFlowSizMethod == DataSizing::SupplyAirFlowRate || this->zoneAirFlowSizMethod == DataSizing::None) {
this->sizingStringScalable = "(scaled by flow / zone) ";
} else if (this->zoneAirFlowSizMethod == DataSizing::FlowPerFloorArea) {
this->sizingStringScalable = "(scaled by flow / area) ";
} else if (this->zoneAirFlowSizMethod == DataSizing::FractionOfAutosizedCoolingAirflow ||
this->zoneAirFlowSizMethod == DataSizing::FractionOfAutosizedHeatingAirflow) {
this->sizingStringScalable = "(scaled by fractional multiplier) ";
} else if (this->zoneAirFlowSizMethod == DataSizing::FlowPerCoolingCapacity ||
this->zoneAirFlowSizMethod == DataSizing::FlowPerHeatingCapacity) {
this->sizingStringScalable = "(scaled by flow / capacity) ";
}
}
if (this->dataDXCoolsLowSpeedsAutozize) {
Expand All @@ -378,8 +377,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b

if (this->isCoilReportObject) {
// SizingResult is airflow in m3/s
state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow(
state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized);
ReportCoilSelection::setCoilAirFlow(state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized);
}
if (this->isFanReportObject) {
// fill fan peak day and time here
Expand All @@ -396,8 +394,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b
dateTimeFanPeak = format("{}/{} {}",
state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month,
state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth,
state.dataRptCoilSelection->coilSelectionReportObj->getTimeText(
state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax));
ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax));
}
} else if (heatingFlow) {
if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 &&
Expand All @@ -406,8 +403,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b
dateTimeFanPeak = format("{}/{} {}",
state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month,
state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth,
state.dataRptCoilSelection->coilSelectionReportObj->getTimeText(
state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax));
ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax));
}
}
}
Expand Down
Loading
Loading