Skip to content
Open

Coil API #11004

Show file tree
Hide file tree
Changes from all commits
Commits
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
232 changes: 132 additions & 100 deletions src/EnergyPlus/AirLoopHVACDOAS.cc

Large diffs are not rendered by default.

41 changes: 9 additions & 32 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,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 @@ -1623,7 +1623,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 @@ -10067,7 +10067,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 @@ -10503,21 +10502,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 @@ -10647,22 +10640,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
7 changes: 3 additions & 4 deletions src/EnergyPlus/Autosizing/All_Simple_Sizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ 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);
ReportCoilSelection::setCoilEntAirTemp(state, this->compName, this->coilType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum);
return this->autoSizedValue;
}

Expand Down Expand Up @@ -346,7 +345,7 @@ 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);
ReportCoilSelection::setCoilLvgAirTemp(state, this->compName, this->coilType, this->autoSizedValue);
return this->autoSizedValue;
}

Expand Down Expand Up @@ -382,7 +381,7 @@ 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);
ReportCoilSelection::setCoilEntAirHumRat(state, this->compName, this->coilType, this->autoSizedValue);
return this->autoSizedValue;
}

Expand Down
16 changes: 5 additions & 11 deletions src/EnergyPlus/Autosizing/Base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,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 @@ -571,16 +573,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 @@ -731,7 +725,7 @@ void BaseSizer::clearState()
sizingDesValueFromParent = false;
airLoopSysFlag = false;
oaSysFlag = false;
coilType_Num = 0;
coilType = HVAC::CoilType::Invalid;
compType = "";
compName = "";
isEpJSON = false;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Autosizing/Base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ 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;
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ 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->coilType,
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
35 changes: 16 additions & 19 deletions src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b
if (Util::SameString(this->compType, "ZoneHVAC:FourPipeFanCoil")) {
this->sizingString = "Maximum Supply Air Flow Rate [m3/s]";
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 @@ -355,18 +355,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 @@ -376,8 +376,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->compName, this->coilType, this->autoSizedValue, this->wasAutoSized);
}
if (this->isFanReportObject) {
// fill fan peak day and time here
Expand All @@ -394,8 +393,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 @@ -404,8 +402,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