-
Notifications
You must be signed in to change notification settings - Fork 421
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
Fix ideal loads heating sizing with outdoor air #7472
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,23 +149,20 @@ TEST_F(EnergyPlusFixture, SizePurchasedAirTest_Test1) | |
DataEnvironment::StdRhoAir = 1.0; // Prevent divide by zero in ReportSizingManager | ||
ZoneEqSizing(CurZoneEqNum).SizingMethod.allocate(24); | ||
CurSysNum = 0; | ||
ZoneHVACSizing.allocate(1); | ||
ZoneHVACSizing(1).CoolingSAFMethod = SupplyAirFlowRate; | ||
ZoneHVACSizing(1).HeatingSAFMethod = SupplyAirFlowRate; | ||
|
||
ZoneEqSizing(CurZoneEqNum).AirVolFlow = 0.0; | ||
FinalZoneSizing.allocate(1); | ||
FinalZoneSizing(CurZoneEqNum).MinOA = 0.0; | ||
FinalZoneSizing(CurZoneEqNum).OutTempAtHeatPeak = 5.0; | ||
FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow = 1.0; | ||
ZoneEqSizing(CurZoneEqNum).HeatingAirVolFlow = 1.0; | ||
FinalZoneSizing(CurZoneEqNum).DesHeatCoilInTemp = 30.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The unit test shouldn't be setting ZoneEqSizing - the component sizing function should be doing that. |
||
FinalZoneSizing(CurZoneEqNum).ZoneTempAtHeatPeak = 30.0; | ||
FinalZoneSizing(CurZoneEqNum).HeatDesTemp = 80.0; | ||
FinalZoneSizing(CurZoneEqNum).HeatDesHumRat = 0.008; | ||
FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow = FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow * DataEnvironment::StdRhoAir; | ||
|
||
FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow = 2.0; | ||
ZoneEqSizing(CurZoneEqNum).CoolingAirVolFlow = 2.0; | ||
FinalZoneSizing(CurZoneEqNum).DesCoolCoilInTemp = 60.0; | ||
FinalZoneSizing(CurZoneEqNum).OutTempAtCoolPeak = 70.0; | ||
FinalZoneSizing(CurZoneEqNum).CoolDesTemp = 50.0; | ||
FinalZoneSizing(CurZoneEqNum).CoolDesHumRat = 0.008; | ||
FinalZoneSizing(CurZoneEqNum).DesCoolCoilInHumRat = 0.010; | ||
|
@@ -179,7 +176,6 @@ TEST_F(EnergyPlusFixture, SizePurchasedAirTest_Test1) | |
PurchAirNumericFields(PurchAirNum).FieldNames(7) = "Maximum Cooling Air Flow Rate"; | ||
PurchAirNumericFields(PurchAirNum).FieldNames(8) = "Maximum Total Cooling Capacity"; | ||
|
||
ZoneEqSizing(CurZoneEqNum).SizingMethod(HeatingAirflowSizing) = SupplyAirFlowRate; | ||
ZoneSizingRunDone = true; | ||
|
||
PurchAir(PurchAirNum).HeatingLimit = LimitFlowRateAndCapacity; | ||
|
@@ -191,22 +187,65 @@ TEST_F(EnergyPlusFixture, SizePurchasedAirTest_Test1) | |
PurchAir(PurchAirNum).cObjectName = "ZONEHVAC:IDEALLOADSAIRSYSTEM"; | ||
PurchAir(PurchAirNum).Name = "Ideal Loads 1"; | ||
|
||
// Need this to prevent crash in RequestSizing | ||
UnitarySysEqSizing.allocate(10); | ||
|
||
SizePurchasedAir(PurchAirNum); | ||
EXPECT_DOUBLE_EQ(1.0, PurchAir(PurchAirNum).MaxHeatVolFlowRate); | ||
EXPECT_NEAR(50985.58, PurchAir(PurchAirNum).MaxHeatSensCap, 0.1); | ||
EXPECT_DOUBLE_EQ(2.0, PurchAir(PurchAirNum).MaxCoolVolFlowRate); | ||
EXPECT_NEAR(30844.14, PurchAir(PurchAirNum).MaxCoolTotCap, 0.1); | ||
} | ||
|
||
TEST_F(EnergyPlusFixture, SizePurchasedAirTest_Test2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a second unit test with OA. |
||
{ | ||
|
||
int PurchAirNum = 1; | ||
ZoneEqSizing.allocate(1); | ||
CurZoneEqNum = 1; | ||
DataEnvironment::StdRhoAir = 1.0; // Prevent divide by zero in ReportSizingManager | ||
ZoneEqSizing(CurZoneEqNum).SizingMethod.allocate(24); | ||
CurSysNum = 0; | ||
|
||
FinalZoneSizing.allocate(1); | ||
FinalZoneSizing(CurZoneEqNum).MinOA = 0.5; | ||
FinalZoneSizing(CurZoneEqNum).OutTempAtHeatPeak = 5.0; | ||
FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow = 1.0; | ||
FinalZoneSizing(CurZoneEqNum).DesHeatCoilInTemp = 30.0; // this isn't used so don't change it | ||
FinalZoneSizing(CurZoneEqNum).ZoneTempAtHeatPeak = 30.0; | ||
FinalZoneSizing(CurZoneEqNum).HeatDesTemp = 80.0; | ||
FinalZoneSizing(CurZoneEqNum).HeatDesHumRat = 0.008; | ||
FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow = FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow * DataEnvironment::StdRhoAir; | ||
|
||
FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow = 2.0; | ||
FinalZoneSizing(CurZoneEqNum).DesCoolCoilInTemp = 65.0; // this is used, so make it higher | ||
FinalZoneSizing(CurZoneEqNum).OutTempAtCoolPeak = 70.0; // this is not currently used for cooling | ||
FinalZoneSizing(CurZoneEqNum).CoolDesTemp = 50.0; | ||
FinalZoneSizing(CurZoneEqNum).CoolDesHumRat = 0.008; | ||
FinalZoneSizing(CurZoneEqNum).DesCoolCoilInHumRat = 0.010; | ||
FinalZoneSizing(CurZoneEqNum).DesCoolMassFlow = FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow * DataEnvironment::StdRhoAir; | ||
|
||
PurchAir.allocate(10); | ||
PurchAirNumericFields.allocate(10); | ||
PurchAirNumericFields(PurchAirNum).FieldNames.allocate(8); | ||
PurchAirNumericFields(PurchAirNum).FieldNames(5) = "Maximum Heating Air Flow Rate"; | ||
PurchAirNumericFields(PurchAirNum).FieldNames(6) = "Maximum Sensible Heating Capacity"; | ||
PurchAirNumericFields(PurchAirNum).FieldNames(7) = "Maximum Cooling Air Flow Rate"; | ||
PurchAirNumericFields(PurchAirNum).FieldNames(8) = "Maximum Total Cooling Capacity"; | ||
|
||
ZoneEqSizing(CurZoneEqNum).SizingMethod.deallocate(); | ||
ZoneEqSizing.deallocate(); | ||
ZoneHVACSizing.deallocate(); | ||
FinalZoneSizing.deallocate(); | ||
PurchAir.deallocate(); | ||
PurchAirNumericFields.deallocate(); | ||
UnitarySysEqSizing.deallocate(); | ||
ZoneSizingRunDone = true; | ||
|
||
PurchAir(PurchAirNum).HeatingLimit = LimitFlowRateAndCapacity; | ||
PurchAir(PurchAirNum).MaxHeatVolFlowRate = AutoSize; | ||
PurchAir(PurchAirNum).MaxHeatSensCap = AutoSize; | ||
PurchAir(PurchAirNum).CoolingLimit = LimitFlowRateAndCapacity; | ||
PurchAir(PurchAirNum).MaxCoolVolFlowRate = AutoSize; | ||
PurchAir(PurchAirNum).MaxCoolTotCap = AutoSize; | ||
PurchAir(PurchAirNum).cObjectName = "ZONEHVAC:IDEALLOADSAIRSYSTEM"; | ||
PurchAir(PurchAirNum).Name = "Ideal Loads 1"; | ||
|
||
SizePurchasedAir(PurchAirNum); | ||
EXPECT_DOUBLE_EQ(1.0, PurchAir(PurchAirNum).MaxHeatVolFlowRate); | ||
EXPECT_NEAR(63731.97, PurchAir(PurchAirNum).MaxHeatSensCap, 0.1); // larger than test 1 above | ||
EXPECT_DOUBLE_EQ(2.0, PurchAir(PurchAirNum).MaxCoolVolFlowRate); | ||
EXPECT_NEAR(41078.43, PurchAir(PurchAirNum).MaxCoolTotCap, 0.1); // larger than test1 above | ||
} | ||
|
||
TEST_F(EnergyPlusFixture, IdealLoadsAirSystem_GetInput) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned out some unnecessary things in the existing unit test.