Skip to content

Commit

Permalink
Merge pull request #4384 from NREL/76890548-Review-CO2-and-contaminan…
Browse files Browse the repository at this point in the history
…t-calculations

76890548 review co2 and contaminant calculations
  • Loading branch information
mjwitte committed Aug 31, 2014
2 parents bfe9a4c + 4b56106 commit 633865a
Showing 1 changed file with 32 additions and 15 deletions.
47 changes: 32 additions & 15 deletions src/EnergyPlus/DualDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1861,13 +1861,21 @@ namespace DualDuct {
Node( OutletNode ).Quality = Node( HotInletNode ).Quality;
Node( OutletNode ).Press = Node( HotInletNode ).Press;

if (Contaminant.CO2Simulation) {
Node(OutletNode).CO2 = max(Node(HotInletNode).CO2, Node(ColdInletNode).CO2);
if ( Contaminant.CO2Simulation ) {
if ( Node( OutletNode ).MassFlowRate > 0.0 ) {
Node( OutletNode ).CO2 = ( Node( HotInletNode ).CO2 * Node( HotInletNode ).MassFlowRate + Node( ColdInletNode ).CO2 * Node( ColdInletNode ).MassFlowRate) / Node( OutletNode ).MassFlowRate;
} else {
Node( OutletNode ).CO2 = max( Node( HotInletNode ).CO2, Node( ColdInletNode ).CO2);
}
}
if (Contaminant.GenericContamSimulation) {
Node(OutletNode).GenContam = max(Node(HotInletNode).GenContam, Node(ColdInletNode).GenContam);
if ( Contaminant.GenericContamSimulation ) {
if ( Node( OutletNode ).MassFlowRate > 0.0) {
Node( OutletNode ).GenContam = ( Node( HotInletNode ).GenContam * Node( HotInletNode ).MassFlowRate + Node( ColdInletNode ).GenContam * Node( ColdInletNode ).MassFlowRate ) / Node( OutletNode ).MassFlowRate;
}
else {
Node( OutletNode ).GenContam = max( Node( HotInletNode ).GenContam, Node( ColdInletNode ).GenContam );
}
}

} else if ( Damper( DamperNum ).DamperType == DualDuct_OutdoorAir ) {

OutletNode = Damper( DamperNum ).OutletNodeNum;
Expand All @@ -1889,26 +1897,35 @@ namespace DualDuct {
Node( OutletNode ).Quality = Node( OAInletNode ).Quality;
Node( OutletNode ).Press = Node( OAInletNode ).Press;

if (Damper(DamperNum).RecircIsUsed) {
if (Contaminant.CO2Simulation) {
Node(OutletNode).CO2 = (Node(OAInletNode).CO2*Node(OAInletNode).MassFlowRate + Node(RAInletNode).CO2*Node(RAInletNode).MassFlowRate) / Node(OutletNode).MassFlowRate;
if ( Damper( DamperNum ).RecircIsUsed ) {
if ( Node( OutletNode ).MassFlowRate > 0.0 ){
if ( Contaminant.CO2Simulation ) {
Node( OutletNode ).CO2 = ( Node( OAInletNode ).CO2 * Node( OAInletNode ).MassFlowRate + Node( RAInletNode ).CO2 * Node( RAInletNode ).MassFlowRate ) / Node( OutletNode ).MassFlowRate;
}
if ( Contaminant.GenericContamSimulation ) {
Node( OutletNode ).GenContam = ( Node( OAInletNode ).GenContam * Node( OAInletNode ).MassFlowRate + Node( RAInletNode ).GenContam * Node( RAInletNode ).MassFlowRate ) / Node( OutletNode ).MassFlowRate;
}
}
if (Contaminant.GenericContamSimulation) {
Node(OutletNode).GenContam = (Node(OAInletNode).GenContam*Node(OAInletNode).MassFlowRate + Node(RAInletNode).GenContam*Node(RAInletNode).MassFlowRate) / Node(OutletNode).MassFlowRate;
else {
if ( Contaminant.CO2Simulation ) {
Node( OutletNode ).CO2 = max( Node( OAInletNode ).CO2, Node( RAInletNode ).CO2 );
}
if ( Contaminant.GenericContamSimulation ) {
Node( OutletNode ).GenContam = max( Node( OAInletNode ).GenContam, Node( RAInletNode ).GenContam );
}
}

} else {
if (Contaminant.CO2Simulation) {
Node(OutletNode).CO2 = Node(OAInletNode).CO2;
if ( Contaminant.CO2Simulation ) {
Node( OutletNode ).CO2 = Node( OAInletNode ).CO2;
}
if (Contaminant.GenericContamSimulation) {
Node(OutletNode).GenContam = Node(OAInletNode).GenContam;
if ( Contaminant.GenericContamSimulation ) {
Node( OutletNode ).GenContam = Node( OAInletNode ).GenContam;
}
}

}


}

// End of Update subroutines for the Damper Module
Expand Down

12 comments on commit 633865a

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (mjwitte) - x86_64-MacOS-10.9-clang: OK (454 of 454 tests passed)

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.

develop (mjwitte) - x86_64-MacOS-10.9-clang-Debug: OK (449 of 454 tests passed)

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.

develop (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (448 of 454 tests passed)

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.

develop (mjwitte) - i386-Windows-7-VisualStudio-12: OK (454 of 454 tests passed)

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.

develop (mjwitte) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

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

develop (mjwitte) - Win64-Windows-7-VisualStudio-12: OK (454 of 454 tests passed)

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.

74721980-AFN-External-Node-Temperature (mjwitte) - i386-Windows-7-VisualStudio-12: OK (454 of 454 tests passed)

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.

74721980-AFN-External-Node-Temperature (mjwitte) - Win64-Windows-7-VisualStudio-12: OK (454 of 454 tests passed)

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.

74721980-AFN-External-Node-Temperature (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (448 of 454 tests passed)

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.

74721980-AFN-External-Node-Temperature (mjwitte) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

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

74721980-AFN-External-Node-Temperature (mjwitte) - x86_64-MacOS-10.9-clang: OK (454 of 454 tests passed)

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.

74721980-AFN-External-Node-Temperature (mjwitte) - x86_64-MacOS-10.9-clang-Debug: OK (449 of 454 tests passed)

Build Badge Test Badge

Please sign in to comment.