Skip to content
Open
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
13 changes: 3 additions & 10 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ namespace AirflowNetwork {
if (FirstHVACIteration) {
if (allocated(m_state.dataAirLoop->AirLoopAFNInfo)) {
for (i = 1; i <= DisSysNumOfCVFs; i++) {
m_state.dataAirLoop->AirLoopAFNInfo(i).AFNLoopHeatingCoilMaxRTF = 0.0;
m_state.dataAirLoop->AirLoopAFNInfo(i).AFNLoopOnOffFanRTF = 0.0;
m_state.dataAirLoop->AirLoopAFNInfo(i).AFNLoopDXCoilRTF = 0.0;
m_state.dataAirLoop->AirLoopAFNInfo(i).LoopOnOffFanPartLoadRatio = 0.0;
}
}
Expand Down Expand Up @@ -9794,14 +9792,9 @@ namespace AirflowNetwork {
// Hard code here
PartLoadRatio = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopOnOffFanPartLoadRatio;
LoopPartLoadRatio(AirLoopNum) = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopOnOffFanPartLoadRatio;
OnOffFanRunTimeFraction = max(m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF,
m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF,
m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF);
LoopOnOffFanRunTimeFraction(AirLoopNum) = max(m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF,
m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF,
m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF);
}
m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = 0.0;
OnOffFanRunTimeFraction = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF;
LoopOnOffFanRunTimeFraction(AirLoopNum) = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF;
}
Comment on lines +9795 to +9797
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Only use fan RTF instead of the maximum of the coils and the fan RTF. All functioning air loops should have fans and when fans are cycling their RTF is the same as the coils.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That makes sense to me.


if (DisSysCompCVFData(FanNum).fanType == HVAC::FanType::OnOff && LoopPartLoadRatio(AirLoopNum) < 1.0) {
for (std::size_t i = 0; i < linkReport.size(); ++i) {
Expand Down
5 changes: 0 additions & 5 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,6 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
// DataAirLoop::LoopDXCoilRTF = max(this->coolingCoilRuntimeFraction, DXCoil(DXCoilNum).HeatingCoilRuntimeFraction);
state.dataAirLoop->LoopDXCoilRTF = this->coolingCoilRuntimeFraction;
state.dataHVACGlobal->DXElecCoolingPower = this->elecCoolingPower;
if (this->airLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(this->airLoopNum).AFNLoopDXCoilRTF = this->coolingCoilRuntimeFraction;
// The original calculation is below, but no heating yet
// max(DXCoil(DXCoilNum).CoolingCoilRuntimeFraction, DXCoil(DXCoilNum).HeatingCoilRuntimeFraction);
}

// report out to the coil sizing report if needed
if (this->reportCoilFinalSizes) {
Expand Down
13 changes: 0 additions & 13 deletions src/EnergyPlus/Furnaces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ namespace Furnaces {
state.dataFurnaces->GetFurnaceInputFlag = false;
}

// Save the current AFNLoopHeatingCoilMaxRTF for comparison with the one calculated below
Real64 refAFNLoopHeatingCoilMaxRTF(0.0);
if (state.afn->distribution_simulated) {
refAFNLoopHeatingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF;
}

// Find the correct Furnace
if (CompIndex == 0) {
FurnaceNum = Util::FindItemInList(FurnaceName, state.dataFurnaces->Furnace);
Expand Down Expand Up @@ -705,8 +699,6 @@ namespace Furnaces {
ShowContinueError(state, EnergyPlus::format("...occurs for {}", thisFurnace.Name));
errorFound = false;
}
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(refAFNLoopHeatingCoilMaxRTF, heatingCoilRTF, suppHeatingCoilRTF);
}

// Reset OnOffFanPartLoadFraction to 1 in case another on/off fan is called without a part-load curve
Expand Down Expand Up @@ -5856,11 +5848,6 @@ namespace Furnaces {
SetOnOffMassFlowRate(state, FurnaceNum, AirLoopNum, OnOffAirFlowRatio, fanOp, ZoneLoad, MoistureLoad, PartLoadRatio);
}
}

// AirflowNetwork global variable
if (state.afn->distribution_simulated) {
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = 0.0;
}
}

void SetOnOffMassFlowRate(EnergyPlusData &state,
Expand Down
16 changes: 0 additions & 16 deletions src/EnergyPlus/HeatingCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1894,18 +1894,6 @@ namespace HeatingCoils {
heatingCoil.OutletAirEnthalpy = Psychrometrics::PsyHFnTdbW(heatingCoil.OutletAirTemp, heatingCoil.OutletAirHumRat);

QCoilActual = HeatingCoilLoad;
if (std::abs(heatingCoil.NominalCapacity) < 1.e-8) {
if (heatingCoil.AirLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF, 0.0);
}
} else {
if (heatingCoil.AirLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF,
HeatingCoilLoad / heatingCoil.NominalCapacity);
}
}
Comment on lines -1897 to -1908
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's great that you were able to strip away so much and keep the same behavior.


// set outlet node temp so parent objects can call calc directly without have to simulate entire model
state.dataLoopNodes->Node(heatingCoil.AirOutletNodeNum).Temp = heatingCoil.OutletAirTemp;
Expand Down Expand Up @@ -2275,10 +2263,6 @@ namespace HeatingCoils {
heatingCoil.OutletAirEnthalpy = Psychrometrics::PsyHFnTdbW(heatingCoil.OutletAirTemp, heatingCoil.OutletAirHumRat);

QCoilActual = HeatingCoilLoad;
if (heatingCoil.AirLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF, heatingCoil.RTF);
}
state.dataHVACGlobal->ElecHeatingCoilPower = heatingCoil.ElecUseLoad;

// set outlet node temp so parent objects can call calc directly without have to simulate entire model
Expand Down
51 changes: 0 additions & 51 deletions src/EnergyPlus/UnitarySystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12725,13 +12725,6 @@ namespace UnitarySystems {
int InletNode = this->CoolCoilInletNodeNum;
Real64 DesOutTemp = this->m_DesiredOutletTemp;
Real64 DesOutHumRat = this->m_DesiredOutletHumRat;
Real64 LoopDXCoilMaxRTFSave = 0.0;
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF;
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = 0.0;
}

std::string CompName = this->m_CoolingCoilName;
HVAC::FanOp fanOp = this->m_FanOpMode;
Real64 SpeedRatio = 0.0;
Expand Down Expand Up @@ -14531,12 +14524,6 @@ namespace UnitarySystems {
this->m_CoolingCycRatio = CycRatio;
this->m_DehumidificationMode = DehumidMode;

if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF =
max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave);
}

if (this->m_coolCoilType == HVAC::CoilType::CoolingWater || this->m_coolCoilType == HVAC::CoilType::CoolingWaterDetailed) {
mdot = PartLoadFrac * this->MaxCoolCoilFluidFlow;
PlantUtilities::SetComponentFlowRate(state, mdot, this->CoolCoilFluidInletNode, this->CoolCoilFluidOutletNodeNum, this->CoolCoilPlantLoc);
Expand Down Expand Up @@ -14584,17 +14571,6 @@ namespace UnitarySystems {
int CompIndex = this->m_HeatingCoilIndex;
HVAC::FanOp fanOp = this->m_FanOpMode;
Real64 DesOutTemp = this->m_DesiredOutletTemp;

Real64 LoopHeatingCoilMaxRTFSave = 0.0;
Real64 LoopDXCoilMaxRTFSave = 0.0;
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
LoopHeatingCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF;
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = 0.0;
LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF;
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = 0.0;
}

Real64 PartLoadFrac = 0.0;
Real64 SpeedRatio = 0.0;
Real64 CycRatio = 0.0;
Expand Down Expand Up @@ -15222,14 +15198,6 @@ namespace UnitarySystems {
this->m_HeatingCycRatio = CycRatio;
HeatCoilLoad = ReqOutput;

if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave);
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF =
max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave);
}

if (this->m_heatCoilType == HVAC::CoilType::HeatingWater || this->m_heatCoilType == HVAC::CoilType::HeatingSteam) {
mdot = PartLoadFrac * this->MaxHeatCoilFluidFlow;
PlantUtilities::SetComponentFlowRate(state, mdot, this->HeatCoilFluidInletNode, this->HeatCoilFluidOutletNodeNum, this->HeatCoilPlantLoc);
Expand Down Expand Up @@ -15272,17 +15240,6 @@ namespace UnitarySystems {
Real64 DesOutTemp = this->m_DesiredOutletTemp;
std::string_view CompName = this->m_SuppHeatCoilName;

Real64 LoopHeatingCoilMaxRTFSave = 0.0;
Real64 LoopDXCoilMaxRTFSave = 0.0;
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum);
LoopHeatingCoilMaxRTFSave = afnInfo.AFNLoopHeatingCoilMaxRTF;
afnInfo.AFNLoopHeatingCoilMaxRTF = 0.0;
LoopDXCoilMaxRTFSave = afnInfo.AFNLoopDXCoilRTF;
afnInfo.AFNLoopDXCoilRTF = 0.0;
}

// IF there is a fault of coil SAT Sensor
if (this->m_FaultyCoilSATFlag) {
// calculate the sensor offset using fault information
Expand Down Expand Up @@ -15635,14 +15592,6 @@ namespace UnitarySystems {
} // IF (NOT EMS OVERRIDE) THEN

} // IF SENSIBLE LOAD
} // IF((GetCurrentScheduleValue(state, UnitarySystem(UnitarySysNum)%m_SysAvailSchedPtr) > 0.0d0) .AND. &

// LoopHeatingCoilMaxRTF used for AirflowNetwork gets set in child components (gas and fuel)
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum);
afnInfo.AFNLoopHeatingCoilMaxRTF = max(afnInfo.AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave);
afnInfo.AFNLoopDXCoilRTF = max(afnInfo.AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave);
}

if (this->m_suppHeatCoilType == HVAC::CoilType::HeatingWater || this->m_suppHeatCoilType == HVAC::CoilType::HeatingSteam) {
Expand Down
4 changes: 0 additions & 4 deletions src/EnergyPlus/VariableSpeedCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ namespace VariableSpeedCoils {
// two additional output variables
varSpeedCoil.SpeedNumReport = SpeedCal;
varSpeedCoil.SpeedRatioReport = SpeedRatio;

if (varSpeedCoil.AirLoopNum > 0 && state.afn->distribution_simulated) {
state.dataAirLoop->AirLoopAFNInfo(varSpeedCoil.AirLoopNum).AFNLoopDXCoilRTF = max(varSpeedCoil.RunFracCool, varSpeedCoil.RunFracHeat);
}
}

void GetVarSpeedCoilInput(EnergyPlusData &state)
Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/Furnaces.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ TEST_F(EnergyPlusFixture, UnitaryHeatCool_AFN_RTF)
SimFurnace(*state, state->dataFurnaces->Furnace(1).Name, FirstHVACIteration, AirLoopNum, CompIndex);

// Check that the runtime fraction is less than one so the impact of cycling fan is correctly accounted for in the AFN
EXPECT_TRUE(state->dataAirLoop->AirLoopAFNInfo(1).AFNLoopHeatingCoilMaxRTF < 1);
EXPECT_TRUE(state->dataAirLoop->AirLoopAFNInfo(1).AFNLoopOnOffFanRTF < 1);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Check for fan RTF instead of coil RTF.


// Check that the system heating capacity is the same as the heating coil
EXPECT_NEAR(state->dataHeatingCoils->HeatingCoil(1).NominalCapacity, state->dataFurnaces->Furnace(1).DesignHeatingCapacity, 1e-6);
Expand Down
Loading