diff --git a/src/EnergyPlus/DualDuct.cc b/src/EnergyPlus/DualDuct.cc index 9d1fc9ba77b..7974886b75b 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -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; @@ -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