Skip to content

Commit

Permalink
Fix PTHP air flow to use actual flow rate instead of rated flow rate.
Browse files Browse the repository at this point in the history
  • Loading branch information
nealkruis committed May 19, 2016
1 parent 94f4e44 commit 23a947e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
4 changes: 4 additions & 0 deletions src/EnergyPlus/Fans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2504,6 +2504,10 @@ namespace Fans {
Node( OutletNode ).GenContam = Node( InletNode ).GenContam;
}

assert(Node( InletNode ).MassFlowRate == Fan( FanNum ).InletAirMassFlowRate);
assert(Node( OutletNode ).MassFlowRate == Fan( FanNum ).OutletAirMassFlowRate);
assert(Node( InletNode ).MassFlowRate == Node( OutletNode ).MassFlowRate);

}

// End of Update subroutines for the Fan Module
Expand Down
38 changes: 19 additions & 19 deletions src/EnergyPlus/PackagedTerminalHeatPump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6476,10 +6476,10 @@ namespace PackagedTerminalHeatPump {
}

if ( HeatingLoad && ( PTUnit( PTUnitNum ).UnitType_Num == PTACUnit ) ) {
CompOnMassFlow = PTUnit( PTUnitNum ).CoolMassFlowRate( PTUnit( PTUnitNum ).NumOfSpeedCooling );
CompOnFlowRatio = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( PTUnit( PTUnitNum ).NumOfSpeedCooling );
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).CoolMassFlowRate( PTUnit( PTUnitNum ).NumOfSpeedCooling );
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).CoolMassFlowRate( PTUnit( PTUnitNum ).NumOfSpeedCooling );
CompOnFlowRatio = 1.0;
CompOnMassFlow = PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
AverageUnitMassFlow = ( PartLoadRatio * CompOnMassFlow ) + ( ( 1 - PartLoadRatio ) * CompOffMassFlow );
if ( CompOffFlowRatio > 0.0 ) {
FanSpeedRatio = ( PartLoadRatio * CompOnFlowRatio ) + ( ( 1 - PartLoadRatio ) * CompOffFlowRatio );
Expand All @@ -6490,27 +6490,27 @@ namespace PackagedTerminalHeatPump {
if ( present( SpeedNum ) ) {
if ( HeatingLoad ) {
if ( SpeedNum == 1 ) {
CompOnMassFlow = PTUnit( PTUnitNum ).HeatMassFlowRate( SpeedNum );
CompOnFlowRatio = PTUnit( PTUnitNum ).MSHeatingSpeedRatio( SpeedNum );
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).HeatMassFlowRate( 1 );
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).HeatMassFlowRate( 1 );
CompOnMassFlow = CompOnFlowRatio * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).MSHeatingSpeedRatio( 1 ) * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).MSHeatingSpeedRatio( 1 ) * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
} else if ( SpeedNum > 1 ) {
CompOnMassFlow = SpeedRatio * PTUnit( PTUnitNum ).HeatMassFlowRate( SpeedNum ) + ( 1.0 - SpeedRatio ) * PTUnit( PTUnitNum ).HeatMassFlowRate( SpeedNum - 1 );
CompOnFlowRatio = SpeedRatio * PTUnit( PTUnitNum ).MSHeatingSpeedRatio( SpeedNum ) + ( 1.0 - SpeedRatio ) * PTUnit( PTUnitNum ).MSHeatingSpeedRatio( SpeedNum - 1 );
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).HeatMassFlowRate( SpeedNum - 1 );
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).HeatMassFlowRate( SpeedNum );
CompOnMassFlow = CompOnFlowRatio * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).MSHeatingSpeedRatio( SpeedNum - 1 ) * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).MSHeatingSpeedRatio( SpeedNum ) * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
}
} else if ( PTUnit( PTUnitNum ).HeatCoolMode == CoolingMode ) {
if ( SpeedNum == 1 ) {
CompOnMassFlow = PTUnit( PTUnitNum ).CoolMassFlowRate( SpeedNum );
CompOnFlowRatio = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( SpeedNum );
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).CoolMassFlowRate( 1 );
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).CoolMassFlowRate( 1 );
CompOnMassFlow = CompOnFlowRatio * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( 1 ) * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( 1 ) * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
} else if ( SpeedNum > 1 ) {
CompOnMassFlow = SpeedRatio * PTUnit( PTUnitNum ).CoolMassFlowRate( SpeedNum ) + ( 1.0 - SpeedRatio ) * PTUnit( PTUnitNum ).CoolMassFlowRate( SpeedNum - 1 );
CompOnFlowRatio = SpeedRatio * PTUnit( PTUnitNum ).MSCoolingSpeedRatio( SpeedNum ) + ( 1.0 - SpeedRatio ) * PTUnit( PTUnitNum ).MSCoolingSpeedRatio( SpeedNum - 1 );
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).CoolMassFlowRate( SpeedNum - 1 );
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).CoolMassFlowRate( SpeedNum );
CompOnMassFlow = CompOnFlowRatio * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
MSHPMassFlowRateLow = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( SpeedNum - 1 ) * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
MSHPMassFlowRateHigh = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( SpeedNum ) * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
}
}
}
Expand All @@ -6519,14 +6519,14 @@ namespace PackagedTerminalHeatPump {
if ( PTUnit( PTUnitNum ).OpMode == ContFanCycCoil && present( SpeedNum ) ) {
if ( PTUnit( PTUnitNum ).AirFlowControl == UseCompressorOnFlow && CompOnMassFlow > 0.0 ) {
if ( SpeedNum == 1 ) { //LOWEST SPEED USE IDLE FLOW
CompOffMassFlow = PTUnit( PTUnitNum ).IdleMassFlowRate;
CompOffFlowRatio = PTUnit( PTUnitNum ).IdleSpeedRatio;
CompOffMassFlow = PTUnit( PTUnitNum ).IdleMassFlowRate;
} else if ( PTUnit( PTUnitNum ).LastMode == HeatingMode ) {
CompOffMassFlow = PTUnit( PTUnitNum ).HeatMassFlowRate( SpeedNum );
CompOffFlowRatio = PTUnit( PTUnitNum ).MSHeatingSpeedRatio( SpeedNum );
CompOffMassFlow = CompOffFlowRatio * PTUnit( PTUnitNum ).MaxHeatAirMassFlow;
} else {
CompOffMassFlow = PTUnit( PTUnitNum ).CoolMassFlowRate( SpeedNum );
CompOffFlowRatio = PTUnit( PTUnitNum ).MSCoolingSpeedRatio( SpeedNum );
CompOffMassFlow = CompOffFlowRatio * PTUnit( PTUnitNum ).MaxCoolAirMassFlow;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/Pumps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,7 @@ namespace Pumps {
Node( OutletNode ).Press = Node( InletNode ).Press;
Node( OutletNode ).Quality = Node( InletNode ).Quality;

assert(Node( OutletNode ).MassFlowRate == Node( InletNode ).MassFlowRate);
}

//*************************************************************************!
Expand Down

8 comments on commit 23a947e

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

conservation-tests (nealkruis) - x86_64-MacOS-10.9-clang: OK (2191 of 2194 tests passed, 0 test warnings)

  • 3 tests had: EIO diffs.
  • 3 tests had: ESO big diffs.
  • 3 tests had: MTR big diffs.
  • 3 tests had: Table big diffs.
  • 1 test had: ERR diffs.

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

conservation-tests (nealkruis) - i386-Windows-7-VisualStudio-12: OK (2196 of 2200 tests passed, 0 test warnings)

  • 3 tests had: EIO diffs.
  • 3 tests had: ESO big diffs.
  • 3 tests had: MTR big diffs.
  • 3 tests had: Table big diffs.
  • 1 test had: ERR diffs.

Build Badge Test 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.

conservation-tests (nealkruis) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build 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.

conservation-tests (nealkruis) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (2229 of 2232 tests passed, 0 test warnings)

  • 3 tests had: EIO diffs.
  • 3 tests had: ESO big diffs.
  • 3 tests had: MTR big diffs.
  • 3 tests had: Table big diffs.
  • 1 test had: ERR diffs.

Build Badge Test 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.

conservation-tests (nealkruis) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1083 of 1086 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.

conservation-tests (nealkruis) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build 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.

conservation-tests (nealkruis) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: Tests Failed (1310 of 1644 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

conservation-tests (nealkruis) - Win64-Windows-7-VisualStudio-12: OK (2195 of 2200 tests passed, 0 test warnings)

  • 3 tests had: EIO diffs.
  • 3 tests had: ESO big diffs.
  • 3 tests had: MTR big diffs.
  • 3 tests had: Table big diffs.
  • 1 test had: ERR diffs.

Build Badge Test Badge

Please sign in to comment.