Skip to content

Commit

Permalink
Add variable speed heating coil to AFN
Browse files Browse the repository at this point in the history
  • Loading branch information
lymereJ committed Oct 14, 2024
1 parent ce81227 commit 5a57a68
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,8 @@ \subsubsection{Inputs}\label{inputs-2016-06-16}
\hyperref[coilcoolingdxvariablespeed]{Coil:Cooling:DX:VariableSpeed}
\item
\hyperref[coilheatingdxmultispeed]{Coil:Heating:DX:MultiSpeed}
\item
\hyperref[coilheatingdxvariablespeed]{Coil:Heating:DX:VariableSpeed}
\item
\hyperref[coilheatingdesuperheater]{Coil:Heating:Desuperheater}
\end{itemize}
Expand Down
1 change: 1 addition & 0 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -26707,6 +26707,7 @@ AirflowNetwork:Distribution:Component:Coil,
\key Coil:Cooling:DX:MultiSpeed
\key Coil:Heating:DX:MultiSpeed
\key Coil:Cooling:DX:VariableSpeed
\key Coil:Heating:DX:VariableSpeed
\key Coil:Heating:Desuperheater
\key Coil:Heating:Electric:MultiStage
\key Coil:Heating:Gas:MultiStage
Expand Down
14 changes: 12 additions & 2 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10610,6 +10610,16 @@ namespace AirflowNetwork {
SetDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
}

} else if (SELECT_CASE_var == "COIL:HEATING:DX:MULTISPEED") {
ValidateComponent(
m_state, "Coil:Heating:DX:MultiSpeed", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
++MultiSpeedHPIndicator;
if (IsNotOK) {
ErrorsFound = true;
} else {
SetDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
}

} else if (SELECT_CASE_var == "COIL:COOLING:DX:VARIABLESPEED") {
ValidateComponent(
m_state, "Coil:Cooling:DX:VariableSpeed", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
Expand All @@ -10620,9 +10630,9 @@ namespace AirflowNetwork {
SetDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum);
}

} else if (SELECT_CASE_var == "COIL:HEATING:DX:MULTISPEED") {
} else if (SELECT_CASE_var == "COIL:HEATING:DX:VARIABLESPEED") {
ValidateComponent(
m_state, "Coil:Heating:DX:MultiSpeed", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
m_state, "Coil:Heating:DX:VariableSpeed", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
++MultiSpeedHPIndicator;
if (IsNotOK) {
ErrorsFound = true;
Expand Down
58 changes: 45 additions & 13 deletions tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6100,14 +6100,14 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_CheckNumOfFansInAirLoopTest)
EXPECT_TRUE(compare_err_stream(error_string, true));
}

TEST_F(EnergyPlusFixture, AirflowNetwork_ValidateVarSpeedCoolingCoil)
TEST_F(EnergyPlusFixture, AirflowNetwork_ValidateDistCoils)
{
std::string const idf_objects = delimited_string({

" Coil:Cooling:DX:VariableSpeed,",
" Super Coil, !- Name",
" Cooling Coil Air Inlet Node_unit1, !- Indoor Air Inlet Node Name",
" Heating Coil Air Inlet Node_unit1, !- Indoor Air Outlet Node Name",
" Super Coil, !- Name",
" Node_1, !- Indoor Air Inlet Node Name",
" Node_2, !- Indoor Air Outlet Node Name",
" 1, !- Number of Speeds {dimensionless}",
" 1, !- Nominal Speed Level {dimensionless}",
" autosize, !- Gross Rated Total Cooling Capacity At Selected Nominal Speed Level {W}",
Expand All @@ -6130,9 +6130,9 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_ValidateVarSpeedCoolingCoil)
" , !- Basin Heater Capacity {W/K}",
" 2, !- Basin Heater Setpoint Temperature {C}",
" , !- Basin Heater Operating Schedule Name",
" 15000, !- Speed 1 Reference Unit Gross Rated Total Cooling Capacity {W}",
" 0.55, !- Speed 1 Reference Unit Gross Rated Sensible Heat Ratio {dimensionless}",
" 4.3, !- Speed 1 Reference Unit Gross Rated Cooling COP {W/W}",
" 15000, !- Speed 1 Reference Unit Gross Rated Total Cooling Capacity {W}",
" 0.55, !- Speed 1 Reference Unit Gross Rated Sensible Heat Ratio {dimensionless}",
" 4.3, !- Speed 1 Reference Unit Gross Rated Cooling COP {W/W}",
" 0.05, !- Speed 1 Reference Unit Rated Air Flow Rate {m3/s}",
" , !- 2017 Speed 1 Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}",
" , !- 2023 Speed 1 Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}",
Expand All @@ -6142,24 +6142,56 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_ValidateVarSpeedCoolingCoil)
" HPCoolingCAPFFF, !- Speed 1 Total Cooling Capacity Function of Air Flow Fraction Curve Name",
" HPCoolingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name",
" HPCoolingEIRFFF; !- Speed 1 Energy Input Ratio Function of Air Flow Fraction Curve Name",
"",
" Coil:Heating:DX:VariableSpeed,",
" Super Heating Coil, !- Name",
" Node_1, !- Indoor Air Inlet Node Name",
" Node_2, !- Indoor Air Outlet Node Name",
" 1, !- Number of Speeds {dimensionless}",
" 1, !- Nominal Speed Level {dimensionless}",
" autosize, !- Rated Heating Capacity At Selected Nominal Speed Level {W}",
" autosize, !- Rated Air Flow Rate At Selected Nominal Speed Level {m3/s}",
" HPHEATPLFFPLR, !- Energy Part Load Fraction Curve Name",
" , !- Defrost Energy Input Ratio Function of Temperature Curve Name",
" -8, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C}",
" , !- Outdoor Dry-Bulb Temperature to Turn On Compressor {C}",
" 5, !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C}",
" , !- Crankcase Heater Capacity {W}",
" , !- Crankcase Heater Capacity Function of Temperature Curve Name",
" 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C}",
" ReverseCycle, !- Defrost Strategy",
" Timed, !- Defrost Control",
" 0.058333, !- Defrost Time Period Fraction",
" , !- Resistive Defrost Heater Capacity {W}",
" 17500, !- Speed 1 Reference Unit Gross Rated Heating Capacity {W}",
" 4.5, !- Speed 1 Reference Unit Gross Rated Heating COP {W/W}",
" 0.05, !- Speed 1 Reference Unit Rated Air Flow Rate {m3/s}",
" 773.3, !- 2017 Speed 1 Rated Supply Air Fan Power Per Volume Flow Rate {W/(m3/s)}",
" 934.4, !- 2023 Speed 1 Rated Supply Air Fan Power Per Volume Flow Rate {W/(m3/s)}",
" HPHeatingCAPFTemp, !- Speed 1 Heating Capacity Function of Temperature Curve Name",
" HPHeatingCAPFFF, !- Speed 1 Total Heating Capacity Function of Air Flow Fraction Curve Name",
" HPHeatingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name",
" HPHeatingEIRFFF; !- Speed 1 Energy Input Ratio Function of Air Flow Fraction Curve Name ",
});

ASSERT_TRUE(process_idf(idf_objects));

state->dataAirSystemsData->PrimaryAirSystems.allocate(1);
state->dataAirSystemsData->PrimaryAirSystems(1).NumBranches = 1;
state->dataAirSystemsData->PrimaryAirSystems(1).Branch.allocate(1);
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).TotalComponents = 1;
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(1);
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).TotalComponents = 2;
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(2);
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).TypeOf = "Coil:Cooling:DX:VariableSpeed";
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).Name = "VariableSpeedCoolingCoil";
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).TypeOf = "Coil:Heating:DX:VariableSpeed";
state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).Name = "VariableSpeedHeatingCoil";

state->afn->DisSysNumOfCoils = 1;
state->afn->DisSysCompCoilData.allocate(1);
state->afn->DisSysNumOfCoils = 2;
state->afn->DisSysCompCoilData.allocate(2);
state->afn->DisSysCompCoilData(1).EPlusType = "COIL:COOLING:DX:VARIABLESPEED";
state->afn->DisSysCompCoilData(1).name = "Super Coil";

int num_coils = state->dataInputProcessing->inputProcessor->getNumObjectsFound(*state, "Coil:Cooling:DX:VariableSpeed");
state->afn->DisSysCompCoilData(2).EPlusType = "COIL:HEATING:DX:VARIABLESPEED";
state->afn->DisSysCompCoilData(2).name = "Super Heating Coil";

state->afn->validate_distribution();
}
Expand Down

4 comments on commit 5a57a68

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

afn_dx_clg_var_spd_coil (lymereJ) - Win64-Windows-10-VisualStudio-16: OK (2895 of 2895 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

afn_dx_clg_var_spd_coil (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2917 of 2917 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

afn_dx_clg_var_spd_coil (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: Tests Failed (0 of 0 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

afn_dx_clg_var_spd_coil (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2099 of 2099 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.