@@ -109,6 +109,10 @@ namespace HeatRecovery {
109109 constexpr std::array<std::string_view, static_cast <int >(FrostControlOption::Num)> frostControlNamesUC = {
110110 " NONE" , " EXHAUSTONLY" , " EXHAUSTAIRRECIRCULATION" , " MINIMUMEXHAUSTTEMPERATURE" };
111111
112+ constexpr std::array<std::string_view, static_cast <int >(HXConfigurationType::Num)> hxConfigurationNames = {" Plate" , " Rotary" };
113+
114+ constexpr std::array<std::string_view, static_cast <int >(HXConfigurationType::Num)> hxConfigurationNamesUC = {" PLATE" , " ROTARY" };
115+
112116 void SimHeatRecovery (EnergyPlusData &state,
113117 std::string_view CompName, // name of the heat exchanger unit
114118 bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
@@ -198,7 +202,7 @@ namespace HeatRecovery {
198202 thisExch.CalcAirToAirPlateHeatExch (state, HXUnitOn, EconomizerFlag, HighHumCtrlFlag);
199203 } break ;
200204
201- case HVAC::HXType::AirToAir_Generic : {
205+ case HVAC::HXType::AirToAir_SensAndLatent : {
202206 thisExch.CalcAirToAirGenericHeatExch (state, HXUnitOn, FirstHVACIteration, fanOp, EconomizerFlag, HighHumCtrlFlag, HXPartLoadRatio);
203207 } break ;
204208
@@ -300,6 +304,7 @@ namespace HeatRecovery {
300304
301305 thisExchanger.Name = state.dataIPShortCut ->cAlphaArgs (1 );
302306 thisExchanger.type = HVAC::HXType::AirToAir_FlatPlate;
307+ thisExchanger.ExchConfig = HXConfigurationType::Plate;
303308 if (state.dataIPShortCut ->lAlphaFieldBlanks (2 )) {
304309 thisExchanger.availSched = Sched::GetScheduleAlwaysOn (state);
305310 } else if ((thisExchanger.availSched = Sched::GetSchedule (state, state.dataIPShortCut ->cAlphaArgs (2 ))) == nullptr ) {
@@ -408,7 +413,7 @@ namespace HeatRecovery {
408413 ErrorsFound);
409414
410415 thisExchanger.Name = state.dataIPShortCut ->cAlphaArgs (1 );
411- thisExchanger.type = HVAC::HXType::AirToAir_Generic ;
416+ thisExchanger.type = HVAC::HXType::AirToAir_SensAndLatent ;
412417 if (state.dataIPShortCut ->lAlphaFieldBlanks (2 )) {
413418 thisExchanger.availSched = Sched::GetScheduleAlwaysOn (state);
414419 } else if ((thisExchanger.availSched = Sched::GetSchedule (state, state.dataIPShortCut ->cAlphaArgs (2 ))) == nullptr ) {
@@ -469,24 +474,12 @@ namespace HeatRecovery {
469474 }
470475 }
471476
472- if (Util::SameString (state.dataIPShortCut ->cAlphaArgs (8 ), " Plate" )) {
473- thisExchanger.ExchConfig = HXConfigurationType::Plate;
474- } else if (Util::SameString (state.dataIPShortCut ->cAlphaArgs (8 ), " Rotary" )) {
475- thisExchanger.ExchConfig = HXConfigurationType::Rotary;
476- } else {
477- ShowSevereError (state, format (" {} configuration not found= {}" , cCurrentModuleObject, state.dataIPShortCut ->cAlphaArgs (8 )));
478- ShowContinueError (state, " HX configuration must be either Plate or Rotary" );
479- ErrorsFound = true ;
480- }
477+ thisExchanger.ExchConfig = static_cast <HXConfigurationType>(getEnumValue (hxConfigurationNamesUC, state.dataIPShortCut ->cAlphaArgs (8 )));
481478
482479 // Added additional inputs for frost control
483480 thisExchanger.FrostControlType = static_cast <FrostControlOption>(getEnumValue (frostControlNamesUC, state.dataIPShortCut ->cAlphaArgs (9 )));
484- if (thisExchanger.FrostControlType == FrostControlOption::Invalid) {
485- ShowSevereError (state, format (" Invalid Frost Control method for {} = {}" , thisExchanger.Name , state.dataIPShortCut ->cAlphaArgs (9 )));
486- ErrorsFound = true ;
487- }
488481
489- if (! Util::SameString (state. dataIPShortCut -> cAlphaArgs ( 9 ), " None" ) ) {
482+ if (thisExchanger. FrostControlType != FrostControlOption:: None) {
490483 thisExchanger.ThresholdTemperature = state.dataIPShortCut ->rNumericArgs (7 );
491484 thisExchanger.InitialDefrostTime = state.dataIPShortCut ->rNumericArgs (8 );
492485 thisExchanger.RateofDefrostTimeIncrease = state.dataIPShortCut ->rNumericArgs (9 );
@@ -552,6 +545,7 @@ namespace HeatRecovery {
552545
553546 thisExchanger.Name = state.dataIPShortCut ->cAlphaArgs (1 );
554547 thisExchanger.type = HVAC::HXType::Desiccant_Balanced;
548+ thisExchanger.ExchConfig = HXConfigurationType::Rotary;
555549 if (state.dataIPShortCut ->lAlphaFieldBlanks (2 )) {
556550 thisExchanger.availSched = Sched::GetScheduleAlwaysOn (state);
557551 } else if ((thisExchanger.availSched = Sched::GetSchedule (state, state.dataIPShortCut ->cAlphaArgs (2 ))) == nullptr ) {
@@ -1339,7 +1333,7 @@ namespace HeatRecovery {
13391333 }
13401334 break ;
13411335
1342- case HVAC::HXType::AirToAir_Generic :
1336+ case HVAC::HXType::AirToAir_SensAndLatent :
13431337 if (this ->SupOutletNode > 0 && this ->ControlToTemperatureSetPoint ) {
13441338 if (state.dataLoopNodes ->Node (this ->SupOutletNode ).TempSetPoint == DataLoopNode::SensedNodeFlagValue) {
13451339 if (!state.dataGlobal ->AnyEnergyManagementSystemInModel ) {
@@ -1416,7 +1410,7 @@ namespace HeatRecovery {
14161410
14171411 switch (this ->type ) {
14181412 case HVAC::HXType::AirToAir_FlatPlate:
1419- case HVAC::HXType::AirToAir_Generic :
1413+ case HVAC::HXType::AirToAir_SensAndLatent :
14201414 break ;
14211415
14221416 case HVAC::HXType::Desiccant_Balanced:
@@ -1533,7 +1527,7 @@ namespace HeatRecovery {
15331527 case HVAC::HXType::Desiccant_Balanced:
15341528 PrintFlag = false ;
15351529 break ;
1536- case HVAC::HXType::AirToAir_Generic :
1530+ case HVAC::HXType::AirToAir_SensAndLatent :
15371531 FieldNum = 1 ;
15381532 break ;
15391533 case HVAC::HXType::AirToAir_FlatPlate:
@@ -1584,7 +1578,13 @@ namespace HeatRecovery {
15841578 this ->NomSupAirVolFlow = sizerSystemAirFlow.size (state, TempSize, errorsFound);
15851579 state.dataSize ->DataConstantUsedForSizing = 0.0 ;
15861580 state.dataSize ->DataFractionUsedForSizing = 0.0 ;
1587- if (this ->type == HVAC::HXType::AirToAir_FlatPlate) {
1581+ switch (this ->type ) {
1582+ case HVAC::HXType::AirToAir_SensAndLatent: {
1583+ this ->NomSecAirVolFlow = this ->NomSupAirVolFlow ;
1584+ state.dataSize ->HRFlowSizingFlag = false ;
1585+ break ;
1586+ }
1587+ case HVAC::HXType::AirToAir_FlatPlate: {
15881588 PrintFlag = true ;
15891589 FieldNum = 5 ;
15901590 CompName = this ->Name ;
@@ -1608,63 +1608,70 @@ namespace HeatRecovery {
16081608 this ->NomSecAirVolFlow = sizerSystemAirFlow2.size (state, TempSize, errorsFound2);
16091609 state.dataSize ->DataConstantUsedForSizing = 0.0 ;
16101610 state.dataSize ->DataFractionUsedForSizing = 0.0 ;
1611- }
1612- state. dataSize -> HRFlowSizingFlag = false ;
1613- if ( this -> type == HVAC::HXType::Desiccant_Balanced) {
1611+ state. dataSize -> HRFlowSizingFlag = false ;
1612+
1613+ // Calculate nominal effectiveness
16141614
1615+ break ;
1616+ }
1617+ case HVAC::HXType::Desiccant_Balanced: {
1618+ state.dataSize ->HRFlowSizingFlag = false ;
16151619 int const BalDesDehumPerfIndex = this ->PerfDataIndex ; // index of dehum performance data1 object
1620+ auto &thisBDDPerf = state.dataHeatRecovery ->BalDesDehumPerfData (BalDesDehumPerfIndex);
16161621
16171622 FieldNum = 1 ;
16181623 PrintFlag = true ;
1619- CompName = state. dataHeatRecovery -> BalDesDehumPerfData (BalDesDehumPerfIndex) .Name ;
1620- CompType = state. dataHeatRecovery -> BalDesDehumPerfData (BalDesDehumPerfIndex) .PerfType ;
1621- SizingString = state. dataHeatRecovery -> BalDesDehumPerfData (BalDesDehumPerfIndex) .NumericFieldNames (FieldNum) + " [m3/s]" ;
1622- TempSize = state. dataHeatRecovery -> BalDesDehumPerfData (BalDesDehumPerfIndex) .NomSupAirVolFlow ;
1624+ CompName = thisBDDPerf .Name ;
1625+ CompType = thisBDDPerf .PerfType ;
1626+ SizingString = thisBDDPerf .NumericFieldNames (FieldNum) + " [m3/s]" ;
1627+ TempSize = thisBDDPerf .NomSupAirVolFlow ;
16231628 bool errorsFound2 = false ;
16241629 SystemAirFlowSizer sizerSystemAirFlow3;
16251630 sizerSystemAirFlow3.overrideSizingString (SizingString);
16261631 // sizerSystemAirFlow3.setHVACSizingIndexData(FanCoil(FanCoilNum).HVACSizingIndex);
16271632 sizerSystemAirFlow3.initializeWithinEP (state, CompType, CompName, PrintFlag, RoutineName);
1628- state.dataHeatRecovery ->BalDesDehumPerfData (BalDesDehumPerfIndex).NomSupAirVolFlow =
1629- sizerSystemAirFlow3.size (state, TempSize, errorsFound2);
1633+ thisBDDPerf.NomSupAirVolFlow = sizerSystemAirFlow3.size (state, TempSize, errorsFound2);
1634+ this ->NomSupAirVolFlow = thisBDDPerf.NomSupAirVolFlow ;
1635+ this ->NomSecAirVolFlow = thisBDDPerf.NomSupAirVolFlow ;
16301636
1631- state.dataSize ->DataAirFlowUsedForSizing = state. dataHeatRecovery -> BalDesDehumPerfData (BalDesDehumPerfIndex) .NomSupAirVolFlow ;
1632- TempSize = state. dataHeatRecovery -> BalDesDehumPerfData (BalDesDehumPerfIndex) .NomProcAirFaceVel ;
1637+ state.dataSize ->DataAirFlowUsedForSizing = thisBDDPerf .NomSupAirVolFlow ;
1638+ TempSize = thisBDDPerf .NomProcAirFaceVel ;
16331639 bool errorsFound3 = false ;
16341640 DesiccantDehumidifierBFPerfDataFaceVelocitySizer sizerDesDehumBFFaceVel;
16351641 sizerDesDehumBFFaceVel.initializeWithinEP (state, CompType, CompName, PrintFlag, RoutineName);
1636- state.dataHeatRecovery ->BalDesDehumPerfData (BalDesDehumPerfIndex).NomProcAirFaceVel =
1637- sizerDesDehumBFFaceVel.size (state, TempSize, errorsFound3);
1642+ thisBDDPerf.NomProcAirFaceVel = sizerDesDehumBFFaceVel.size (state, TempSize, errorsFound3);
16381643
16391644 state.dataSize ->DataAirFlowUsedForSizing = 0.0 ;
1645+ break ;
1646+ }
1647+ default :
1648+ assert (0 );
16401649 }
16411650
16421651 // std 229 new heat recovery table variables
1643- OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRInputObjName , this ->Name , this ->Name );
1644- OutputReportPredefined::PreDefTableEntry (state,
1645- state.dataOutRptPredefined ->pdchAirHRInputObjType ,
1646- this ->Name ,
1647- this ->type == HVAC::HXType::AirToAir_FlatPlate
1648- ? " Flat Plate"
1649- : (this ->type == HVAC::HXType::Desiccant_Balanced ? " Desiccant Balanced" : " Generic" ));
1650- OutputReportPredefined::PreDefTableEntry (state,
1651- state.dataOutRptPredefined ->pdchAirHRPlateOrRotary ,
1652- this ->Name ,
1653- this ->type == HVAC::HXType::AirToAir_FlatPlate ? " FlatPlate" : " Rotary" );
1654-
1652+ assert ((this ->type != HVAC::HXType::Invalid) && (this ->ExchConfig != HXConfigurationType::Invalid));
16551653 OutputReportPredefined::PreDefTableEntry (
1656- state, state.dataOutRptPredefined ->pdchAirHRSenEffAt100PerHeatAirFlow , this ->Name , this ->HeatEffectSensible100 );
1654+ state, state.dataOutRptPredefined ->pdchAirHRInputObjType , this ->Name , HVAC::hxTypeNames[( int ) this ->type ] );
16571655 OutputReportPredefined::PreDefTableEntry (
1658- state, state.dataOutRptPredefined ->pdchAirHRSenEffAt100PerCoolAirFlow , this ->Name , this ->CoolEffectSensible100 );
1659- OutputReportPredefined::PreDefTableEntry (
1660- state, state.dataOutRptPredefined ->pdchAirHRLatEffAt100PerHeatAirFlow , this ->Name , this ->HeatEffectLatent100 );
1661- OutputReportPredefined::PreDefTableEntry (
1662- state, state.dataOutRptPredefined ->pdchAirHRLatEffAt100PerCoolAirFlow , this ->Name , this ->CoolEffectLatent100 );
1663-
1664- OutputReportPredefined::PreDefTableEntry (
1665- state, state.dataOutRptPredefined ->pdchAirHRExhaustAirflow , this ->Name , this ->NomSecAirMassFlow ); // ? Nomsec ==? exhaust?
1666- OutputReportPredefined::PreDefTableEntry (
1667- state, state.dataOutRptPredefined ->pdchAirHROutdoorAirflow , this ->Name , this ->NomSupAirMassFlow ); // ? NomSup ==? outdoor air?
1656+ state, state.dataOutRptPredefined ->pdchAirHRPlateOrRotary , this ->Name , hxConfigurationNames[(int )this ->ExchConfig ]);
1657+ OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRSupplyAirflow , this ->Name , this ->NomSupAirVolFlow );
1658+ OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRExhaustAirflow , this ->Name , this ->NomSecAirVolFlow );
1659+
1660+ if (this ->type == HVAC::HXType::AirToAir_SensAndLatent) {
1661+ OutputReportPredefined::PreDefTableEntry (
1662+ state, state.dataOutRptPredefined ->pdchAirHRSenEffAt100PerHeatAirFlow , this ->Name , this ->HeatEffectSensible100 );
1663+ OutputReportPredefined::PreDefTableEntry (
1664+ state, state.dataOutRptPredefined ->pdchAirHRSenEffAt100PerCoolAirFlow , this ->Name , this ->CoolEffectSensible100 );
1665+ OutputReportPredefined::PreDefTableEntry (
1666+ state, state.dataOutRptPredefined ->pdchAirHRLatEffAt100PerHeatAirFlow , this ->Name , this ->HeatEffectLatent100 );
1667+ OutputReportPredefined::PreDefTableEntry (
1668+ state, state.dataOutRptPredefined ->pdchAirHRLatEffAt100PerCoolAirFlow , this ->Name , this ->CoolEffectLatent100 );
1669+ } else {
1670+ OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRSenEffAt100PerHeatAirFlow , this ->Name , " N/A" );
1671+ OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRSenEffAt100PerCoolAirFlow , this ->Name , " N/A" );
1672+ OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRLatEffAt100PerHeatAirFlow , this ->Name , " N/A" );
1673+ OutputReportPredefined::PreDefTableEntry (state, state.dataOutRptPredefined ->pdchAirHRLatEffAt100PerCoolAirFlow , this ->Name , " N/A" );
1674+ }
16681675 }
16691676
16701677 void
0 commit comments