LCOV - code coverage report
Current view: top level - EnergyPlus - HVACMultiSpeedHeatPump.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 10 32 31.2 %
Date: 2023-01-17 19:17:23 Functions: 6 8 75.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : #ifndef HVACMultiSpeedHeatPump_hh_INCLUDED
      49             : #define HVACMultiSpeedHeatPump_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : #include <ObjexxFCL/Optional.hh>
      54             : 
      55             : // EnergyPlus Headers
      56             : #include <EnergyPlus/Data/BaseData.hh>
      57             : #include <EnergyPlus/DataGlobals.hh>
      58             : #include <EnergyPlus/EnergyPlus.hh>
      59             : 
      60             : namespace EnergyPlus {
      61             : 
      62             : // Forward declarations
      63             : struct EnergyPlusData;
      64             : 
      65             : namespace HVACMultiSpeedHeatPump {
      66             : 
      67             :     // Heating coil types
      68             :     int constexpr MultiSpeedHeatingCoil(1); // COIL:DX:MultiSpeed:Heating
      69             :     // Cooling coil types
      70             :     int constexpr MultiSpeedCoolingCoil(2); // COIL:DX:MultiSpeed:Cooling
      71             :     // Supplymental heating coil types
      72             :     int constexpr SuppHeatingCoilGas(1);  // Supplymental heating coil type: COIL:GAS:HEATING
      73             :     int constexpr SuppHeatingCoilElec(2); // Supplymental heating coil type: COIL:ELECTRIC:HEATING
      74             :     int constexpr SuppHeatingCoilRec(3);  // Supplymental heating coil type: COIL:ENGINEHEATRECOVERY:HEATING
      75             : 
      76             :     // Mode of operation
      77             :     enum class ModeOfOperation
      78             :     {
      79             :         Invalid = -1,
      80             :         CoolingMode, // System operating mode is cooling
      81             :         HeatingMode, // System operating mode is heating
      82             :         Num
      83             :     };
      84             : 
      85             :     // Airflow control for constant fan mode
      86             :     enum class AirflowControl
      87             :     {
      88             :         Invalid = -1,
      89             :         UseCompressorOnFlow,  // set compressor OFF air flow rate equal to compressor ON air flow rate
      90             :         UseCompressorOffFlow, // set compressor OFF air flow rate equal to user defined value
      91             :         Num
      92             :     };
      93             : 
      94             :     // Types
      95             : 
      96          33 :     struct MSHeatPumpData
      97             :     {
      98             :         // Members
      99             :         // Some variables in this type are arrays (dimension=MaxSpeed) to support the number of speeds
     100             :         std::string Name;                   // Name of the engine driven heat pump
     101             :         std::string AvaiSchedule;           // Availability Schedule name
     102             :         int AvaiSchedPtr;                   // Pointer to the correct schedule
     103             :         int AirInletNodeNum;                // Node number of the heat pump air inlet
     104             :         int AirOutletNodeNum;               // Node number of the heat pump air inlet
     105             :         std::string AirInletNodeName;       // Node name of the heat pump air inlet
     106             :         std::string AirOutletNodeName;      // Node name of the heat pump air outlet
     107             :         int ControlZoneNum;                 // Controlling zone or thermostat location
     108             :         int ZoneSequenceCoolingNum;         // Index to cooling sequence/priority for this zone
     109             :         int ZoneSequenceHeatingNum;         // Index to heating sequence/priority for this zone
     110             :         std::string ControlZoneName;        // Controlled zone name
     111             :         int NodeNumOfControlledZone;        // Controlled zone node number
     112             :         Real64 FlowFraction;                // Fraction of the total volume flow that goes through the controlling zone
     113             :         std::string FanName;                // Name of supply air fan
     114             :         int FanType;                        // Supply fan type
     115             :         int FanNum;                         // Supply fan number
     116             :         int FanPlaceType;                   // Supply air fan placement: 1 Blow through; 2 Draw through
     117             :         int FanInletNode;                   // Fan Inlet node
     118             :         int FanOutletNode;                  // Fan Outlet node
     119             :         Real64 FanVolFlow;                  // Supply fan volumetric flow rate
     120             :         std::string FanSchedule;            // Supply air fan operating mode schedule name
     121             :         int FanSchedPtr;                    // Pointer to the Supply air fan operating mode schedule
     122             :         int OpMode;                         // mode of operation; 1=cycling fan, cycling compressor; 2=continuous fan, cycling compresor
     123             :         std::string DXHeatCoilName;         // COIL:DX:MultiSpeed:Heating name
     124             :         int HeatCoilType;                   // Heating coil type: 1 COIL:DX:MultiSpeed:Heating only
     125             :         int HeatCoilNum;                    // Heating coil number
     126             :         int DXHeatCoilIndex;                // DX heating coil index number
     127             :         std::string HeatCoilName;           // Coil:Electric:MultiSpeed:Heating OR Coil:Gas:MultiSpeed:Heating name
     128             :         int HeatCoilIndex;                  // heating coil index number (Coil:Electric:MultiSpeed:Heating OR Coil:Gas:MultiSpeed:Heating)
     129             :         std::string DXCoolCoilName;         // COIL:DX:MultiSpeed:Cooling name
     130             :         int CoolCoilType;                   // Cooling coil type: 1 COIL:DX:MultiSpeed:Cooling only
     131             :         int DXCoolCoilIndex;                // DX cooling coil index number
     132             :         std::string SuppHeatCoilName;       // Supplymental heating coil name
     133             :         int SuppHeatCoilType;               // Supplymental heating coil type: 1 Gas; 2 Electric; 3 Recovery
     134             :         int SuppHeatCoilNum;                // Supplymental heating coil number
     135             :         Real64 DesignSuppHeatingCapacity;   // Supplemental heating coil design capacity
     136             :         Real64 SuppMaxAirTemp;              // Maximum supply air temperature from supplemental heater
     137             :         Real64 SuppMaxOATemp;               // Maximum outdoor dry-bulb temperature for supplemental heater operation
     138             :         Real64 AuxOnCyclePower;             // Auxiliary On-Cycle Electric Power
     139             :         Real64 AuxOffCyclePower;            // Auxiliary Off-Cycle Electric Power
     140             :         Real64 DesignHeatRecFlowRate;       // Design water volume flow rate through heat recovery loop [m3/s]
     141             :         bool HeatRecActive;                 // True when entered Heat Rec Vol Flow Rate > 0
     142             :         std::string HeatRecName;            // heat recovery water inlet name
     143             :         int HeatRecInletNodeNum;            // Node number on heat recovery water inlet
     144             :         int HeatRecOutletNodeNum;           // Node number on heat recovery water outlet
     145             :         Real64 MaxHeatRecOutletTemp;        // Maximum outlet water temperature for heat recovery
     146             :         Real64 DesignHeatRecMassFlowRate;   // Design water mass flow rate through heat recovery loop [kg/s]
     147             :         PlantLocation HRPlantLoc;           // plant loop component for heat recovery
     148             :         Real64 AuxElecPower;                // Auxiliary Electric Power
     149             :         Real64 IdleVolumeAirRate;           // Supply air volumetric flow rate when no cooling or heating is needed
     150             :         Real64 IdleMassFlowRate;            // Supply air mass flow rate when no cooling or heating is needed
     151             :         Real64 IdleSpeedRatio;              // Fan speed ratio in idle mode
     152             :         int NumOfSpeedCooling;              // The number of speeds for cooling
     153             :         int NumOfSpeedHeating;              // The number of speeds for heating
     154             :         Array1D<Real64> HeatVolumeFlowRate; // Supply air volume flow rate during heating operation
     155             :         Array1D<Real64> HeatMassFlowRate;   // Supply air mass flow rate during heating operation
     156             :         Array1D<Real64> CoolVolumeFlowRate; // Supply air volume flow rate during cooling operation
     157             :         Array1D<Real64> CoolMassFlowRate;   // Supply air mass flow rate during cooling operation
     158             :         Array1D<Real64> HeatingSpeedRatio;  // Fan speed ratio in heating mode
     159             :         Array1D<Real64> CoolingSpeedRatio;  // Fan speed ratio in cooling mode
     160             :         bool CheckFanFlow;                  // Supply airflow check
     161             :         ModeOfOperation LastMode;           // MSHP operation mode
     162             :         ModeOfOperation HeatCoolMode;       // System operating mode (0 = floating, 1 = cooling, 2 = heating)
     163             :         int AirLoopNumber;                  // Air loop served by the engine driven heat pump system
     164             :         int NumControlledZones;             // Number of controlled zones for this system
     165             :         int ZoneInletNode;                  // Zone inlet node number in the controlled zone
     166             :         Real64 CompPartLoadRatio;           // Compressor part load ratio
     167             :         Real64 FanPartLoadRatio;            // Fan part load ratio
     168             :         Real64 TotCoolEnergyRate;           // Total cooling enertgy rate
     169             :         Real64 TotHeatEnergyRate;           // Total heating enertgy rate
     170             :         Real64 SensCoolEnergyRate;          // Sensible cooling enertgy rate
     171             :         Real64 SensHeatEnergyRate;          // Sensible heating enertgy rate
     172             :         Real64 LatCoolEnergyRate;           // Latent cooling enertgy rate
     173             :         Real64 LatHeatEnergyRate;           // Latent heating enertgy rate
     174             :         Real64 ElecPower;                   // Electric power (fan + supplemental electric coil)
     175             :         Real64 LoadMet;                     // met system load
     176             :         Real64 HeatRecoveryRate;            // Heat recovery rate [W]
     177             :         Real64 HeatRecoveryInletTemp;       // Inlet temperature for heat recovery rate [C]
     178             :         Real64 HeatRecoveryOutletTemp;      // Outlet temperature for heat recovery rate [C]
     179             :         Real64 HeatRecoveryMassFlowRate;    // Mass flow rate for heat recovery rate [kg/s]
     180             :         AirflowControl AirFlowControl;      // fan control mode, UseCompressorOnFlow or UseCompressorOffFlow
     181             :         int ErrIndexCyc;                    // Error index at low speed
     182             :         int ErrIndexVar;                    // Error index at high speed
     183             :         Real64 LoadLoss;                    // Air distribution system loss
     184             :         int SuppCoilAirInletNode;           // air inlet node number of supplemental heating coil
     185             :         int SuppCoilAirOutletNode;          // air outlet node number of supplemental heating coil
     186             :         int SuppHeatCoilType_Num;           // Numeric Equivalent for Supplemental Heat Coil Type
     187             :         int SuppHeatCoilIndex;              // Index to supplemental heater
     188             :         int SuppCoilControlNode;            // control node for simple water and steam heating coil
     189             :         Real64 MaxSuppCoilFluidFlow;        // water or steam mass flow rate for supplemental heating coil [kg/s]
     190             :         int SuppCoilOutletNode;             // outlet node for hot water and steam supplemental heating coil
     191             :         int CoilAirInletNode;               // air inlet node number of supplemental heating coil
     192             :         int CoilControlNode;                // control node for simple water and steam heating coil
     193             :         Real64 MaxCoilFluidFlow;            // water or steam mass flow rate for supplemental heating coil [kg/s]
     194             :         int CoilOutletNode;                 // outlet node for hot water and steam supplemental heating coil
     195             :         int HotWaterCoilControlNode;
     196             :         int HotWaterCoilOutletNode;
     197             :         std::string HotWaterCoilName;
     198             :         int HotWaterCoilNum;
     199             :         PlantLocation plantLoc;         // plant loop component location for hot water and steam heating coil
     200             :         PlantLocation SuppPlantLoc;     // plant loop component location for hot water and steam supplemental heating coil
     201             :         PlantLocation HotWaterPlantLoc; // plant loop component location for hot water and steam heating coil
     202             :         int HotWaterCoilMaxIterIndex;   // Index to recurring warning message
     203             :         int HotWaterCoilMaxIterIndex2;  // Index to recurring warning message
     204             :         int StageNum;                   // Stage number specified by staged thermostat
     205             :         bool Staged;                    // Using Staged thermostat
     206             :         int CoolCountAvail;             // Counter used to minimize the occurrence of output warnings
     207             :         int CoolIndexAvail;             // Index used to minimize the occurrence of output warnings
     208             :         int HeatCountAvail;             // Counter used to minimize the occurrence of output warnings
     209             :         int HeatIndexAvail;             // Index used to minimize the occurrence of output warnings
     210             :         bool FirstPass;                 // used to determine when first call is made
     211             :         Array1D<Real64> FullOutput;     // Full output for different speed
     212             :         Real64 MinOATCompressorCooling; // min OAT from multispeed cooling coil object
     213             :         Real64 MinOATCompressorHeating; // min OAT from multispeed heating coil object
     214             :         bool MyEnvrnFlag;
     215             :         bool MySizeFlag;
     216             :         bool MyCheckFlag;
     217             :         bool MyFlowFracFlag;
     218             :         bool MyPlantScantFlag;
     219             :         bool MyStagedFlag;
     220             :         bool EMSOverrideCoilSpeedNumOn;
     221             :         Real64 EMSOverrideCoilSpeedNumValue;
     222             :         int CoilSpeedErrIndex;
     223             : 
     224             :         // Default Constructor
     225          11 :         MSHeatPumpData()
     226          11 :             : AvaiSchedPtr(0), AirInletNodeNum(0), AirOutletNodeNum(0), ControlZoneNum(0), ZoneSequenceCoolingNum(0), ZoneSequenceHeatingNum(0),
     227             :               NodeNumOfControlledZone(0), FlowFraction(0.0), FanType(0), FanNum(0), FanPlaceType(0), FanInletNode(0), FanOutletNode(0),
     228             :               FanVolFlow(0.0), FanSchedPtr(0), OpMode(0), HeatCoilType(0), HeatCoilNum(0), DXHeatCoilIndex(0), HeatCoilIndex(0), CoolCoilType(0),
     229             :               DXCoolCoilIndex(0), SuppHeatCoilType(0), SuppHeatCoilNum(0), DesignSuppHeatingCapacity(0.0), SuppMaxAirTemp(0.0), SuppMaxOATemp(0.0),
     230             :               AuxOnCyclePower(0.0), AuxOffCyclePower(0.0), DesignHeatRecFlowRate(0.0), HeatRecActive(false), HeatRecInletNodeNum(0),
     231             :               HeatRecOutletNodeNum(0), MaxHeatRecOutletTemp(0.0), DesignHeatRecMassFlowRate(0.0), HRPlantLoc{}, AuxElecPower(0.0),
     232             :               IdleVolumeAirRate(0.0), IdleMassFlowRate(0.0), IdleSpeedRatio(0.0), NumOfSpeedCooling(0), NumOfSpeedHeating(0), CheckFanFlow(true),
     233             :               LastMode(ModeOfOperation::Invalid), HeatCoolMode(ModeOfOperation::Invalid), AirLoopNumber(0), NumControlledZones(0), ZoneInletNode(0),
     234             :               CompPartLoadRatio(0.0), FanPartLoadRatio(0.0), TotCoolEnergyRate(0.0), TotHeatEnergyRate(0.0), SensCoolEnergyRate(0.0),
     235             :               SensHeatEnergyRate(0.0), LatCoolEnergyRate(0.0), LatHeatEnergyRate(0.0), ElecPower(0.0), LoadMet(0.0), HeatRecoveryRate(0.0),
     236             :               HeatRecoveryInletTemp(0.0), HeatRecoveryOutletTemp(0.0), HeatRecoveryMassFlowRate(0.0), AirFlowControl(AirflowControl::Invalid),
     237             :               ErrIndexCyc(0), ErrIndexVar(0), LoadLoss(0.0), SuppCoilAirInletNode(0), SuppCoilAirOutletNode(0), SuppHeatCoilType_Num(0),
     238             :               SuppHeatCoilIndex(0), SuppCoilControlNode(0), MaxSuppCoilFluidFlow(0.0), SuppCoilOutletNode(0), CoilAirInletNode(0), CoilControlNode(0),
     239             :               MaxCoilFluidFlow(0.0), CoilOutletNode(0), HotWaterCoilControlNode(0), plantLoc{}, SuppPlantLoc{}, HotWaterPlantLoc{},
     240             :               HotWaterCoilMaxIterIndex(0), HotWaterCoilMaxIterIndex2(0), StageNum(0), Staged(false), CoolCountAvail(0), CoolIndexAvail(0),
     241             :               HeatCountAvail(0), HeatIndexAvail(0), FirstPass(true), MinOATCompressorCooling(0.0), MinOATCompressorHeating(0.0), MyEnvrnFlag(true),
     242             :               MySizeFlag(true), MyCheckFlag(true), MyFlowFracFlag(true), MyPlantScantFlag(true), MyStagedFlag(true), EMSOverrideCoilSpeedNumOn(false),
     243          11 :               EMSOverrideCoilSpeedNumValue(0.0), CoilSpeedErrIndex(0)
     244             :         {
     245          11 :         }
     246             :     };
     247             : 
     248             :     struct MSHeatPumpReportData
     249             :     {
     250             :         // Members
     251             :         Real64 ElecPowerConsumption;   // Electricity Rate comsumption: CondenserFan+CrankcaseHeater+Defroster+aux
     252             :         Real64 HeatRecoveryEnergy;     // Heat recovery rate [J]
     253             :         Real64 CycRatio;               // Cycle ratio
     254             :         Real64 SpeedRatio;             // Speed ratio between two stages
     255             :         int SpeedNum;                  // Speed number
     256             :         Real64 AuxElecCoolConsumption; // Auxiliary Electricity Rate consumption during cooling
     257             :         Real64 AuxElecHeatConsumption; // Auxiliary Electricity Rate consumption during heating
     258             : 
     259             :         // Default Constructor
     260          11 :         MSHeatPumpReportData()
     261          11 :             : ElecPowerConsumption(0.0), HeatRecoveryEnergy(0.0), CycRatio(0.0), SpeedRatio(0.0), SpeedNum(0), AuxElecCoolConsumption(0.0),
     262          11 :               AuxElecHeatConsumption(0.0)
     263             :         {
     264          11 :         }
     265             :     };
     266             : 
     267             :     void SimMSHeatPump(EnergyPlusData &state,
     268             :                        std::string_view CompName,     // Name of the unitary engine driven heat pump system
     269             :                        bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system time step
     270             :                        int const AirLoopNum,          // air loop index
     271             :                        int &CompIndex                 // Index to changeover-bypass VAV system
     272             :     );
     273             : 
     274             :     //******************************************************************************
     275             : 
     276             :     void SimMSHP(EnergyPlusData &state,
     277             :                  int const MSHeatPumpNum,       // number of the current engine driven Heat Pump being simulated
     278             :                  bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     279             :                  int const AirLoopNum,          // air loop index
     280             :                  Real64 &QSensUnitOut,          // cooling/heating deliveded to zones [W]
     281             :                  Real64 const QZnReq,           // required zone load
     282             :                  Real64 &OnOffAirFlowRatio      // ratio of compressor ON airflow to AVERAGE airflow over timestep
     283             :     );
     284             : 
     285             :     //******************************************************************************
     286             : 
     287             :     void GetMSHeatPumpInput(EnergyPlusData &state);
     288             : 
     289             :     //******************************************************************************
     290             : 
     291             :     void InitMSHeatPump(EnergyPlusData &state,
     292             :                         int const MSHeatPumpNum,       // Engine driven heat pump number
     293             :                         bool const FirstHVACIteration, // TRUE if first HVAC iteration
     294             :                         int const AirLoopNum,          // air loop index
     295             :                         Real64 &QZnReq,                // Heating/Cooling load for all served zones
     296             :                         Real64 &OnOffAirFlowRatio      // Ratio of compressor ON airflow to average airflow over timestep
     297             :     );
     298             : 
     299             :     //******************************************************************************
     300             : 
     301             :     void SizeMSHeatPump(EnergyPlusData &state, int const MSHeatPumpNum); // Engine driven heat pump number
     302             : 
     303             :     //******************************************************************************
     304             : 
     305             :     void ControlMSHPOutput(EnergyPlusData &state,
     306             :                            int const MSHeatPumpNum,                           // Unit index of engine driven heat pump
     307             :                            bool const FirstHVACIteration,                     // flag for 1st HVAC iteration in the time step
     308             :                            DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
     309             :                            int const OpMode,                                  // operating mode: CycFanCycCoil | ContFanCycCoil
     310             :                            Real64 const QZnReq,                               // cooling or heating output needed by zone [W]
     311             :                            int const ZoneNum,                                 // Index to zone number
     312             :                            int &SpeedNum,                                     // Speed number
     313             :                            Real64 &SpeedRatio,                                // unit speed ratio for DX coils
     314             :                            Real64 &PartLoadFrac,                              // unit part load fraction
     315             :                            Real64 &OnOffAirFlowRatio,                         // ratio of compressor ON airflow to AVERAGE airflow over timestep
     316             :                            Real64 &SupHeaterLoad                              // Supplemental heater load [W]
     317             :     );
     318             : 
     319             :     void ControlMSHPSupHeater(EnergyPlusData &state,
     320             :                               int const MSHeatPumpNum,                           // Unit index of engine driven heat pump
     321             :                               bool const FirstHVACIteration,                     // flag for 1st HVAC iteration in the time step
     322             :                               DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
     323             :                               int const OpMode,                                  // operating mode: CycFanCycCoil | ContFanCycCoil
     324             :                               Real64 const QZnReq,                               // cooling or heating output needed by zone [W]
     325             :                               int const FullOutput,                              // unit full output when compressor is operating [W]vvvv
     326             :                               int const SpeedNum,                                // Speed number
     327             :                               Real64 SpeedRatio,                                 // unit speed ratio for DX coils
     328             :                               Real64 PartLoadFrac,                               // unit part load fraction
     329             :                               Real64 OnOffAirFlowRatio,                          // ratio of compressor ON airflow to AVERAGE airflow over timestep
     330             :                               Real64 &SupHeaterLoad                              // Supplemental heater load [W]
     331             : 
     332             :     );
     333             : 
     334             :     void ControlMSHPOutputEMS(EnergyPlusData &state,
     335             :                               int const MSHeatPumpNum,                           // Unit index of engine driven heat pump
     336             :                               bool const FirstHVACIteration,                     // flag for 1st HVAC iteration in the time step
     337             :                               DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
     338             :                               int const OpMode,                                  // operating mode: CycFanCycCoil | ContFanCycCoil
     339             :                               Real64 const QZnReq,                               // cooling or heating output needed by zone [W]
     340             :                               Real64 const SpeedVal,                             // continuous speed value
     341             :                               int &SpeedNum,                                     // discrete speed level
     342             :                               Real64 &SpeedRatio,                                // unit speed ratio for DX coils
     343             :                               Real64 &PartLoadFrac,                              // unit part load fraction
     344             :                               Real64 &OnOffAirFlowRatio,                         // ratio of compressor ON airflow to AVERAGE airflow over timestep
     345             :                               Real64 &SupHeaterLoad                              // Supplemental heater load [W]
     346             : 
     347             :     );
     348             : 
     349             :     //******************************************************************************
     350             : 
     351             :     void CalcMSHeatPump(EnergyPlusData &state,
     352             :                         int const MSHeatPumpNum,                           // Engine driven heat pump number
     353             :                         bool const FirstHVACIteration,                     // Flag for 1st HVAC iteration
     354             :                         DataHVACGlobals::CompressorOperation CompressorOp, // Compressor on/off; 1=on, 0=off
     355             :                         int const SpeedNum,                                // Speed number
     356             :                         Real64 const SpeedRatio,                           // Compressor speed ratio
     357             :                         Real64 const PartLoadFrac,                         // Compressor part load fraction
     358             :                         Real64 &LoadMet,                                   // Load met by unit (W)
     359             :                         Real64 const QZnReq,                               // Zone load (W)
     360             :                         Real64 &OnOffAirFlowRatio,                         // Ratio of compressor ON airflow to AVERAGE airflow over timestep
     361             :                         Real64 &SupHeaterLoad                              // supplemental heater load (W)
     362             :     );
     363             : 
     364             :     void UpdateMSHeatPump(EnergyPlusData &state, int const MSHeatPumpNum); // Engine driven heat pump number
     365             : 
     366             :     void ReportMSHeatPump(EnergyPlusData &state, int const MSHeatPumpNum); // Engine driven heat pump number
     367             : 
     368             :     void MSHPHeatRecovery(EnergyPlusData &state,
     369             :                           int const MSHeatPumpNum); // Number of the current electric MSHP being simulated
     370             : 
     371             :     void SetAverageAirFlow(EnergyPlusData &state,
     372             :                            int const MSHeatPumpNum,              // Unit index
     373             :                            Real64 const PartLoadRatio,           // unit part load ratio
     374             :                            Real64 &OnOffAirFlowRatio,            // ratio of compressor ON airflow to average airflow over timestep
     375             :                            Optional_int_const SpeedNum = _,      // Speed number
     376             :                            Optional<Real64 const> SpeedRatio = _ // Speed ratio
     377             :     );
     378             : 
     379             :     void CalcNonDXHeatingCoils(EnergyPlusData &state,
     380             :                                int const MSHeatPumpNum,       // multispeed heatpump index
     381             :                                bool const FirstHVACIteration, // flag for first HVAC iteration in the time step
     382             :                                Real64 const HeatingLoad,      // supplemental coil load to be met by unit (watts)
     383             :                                int const FanMode,             // fan operation mode
     384             :                                Real64 &HeatCoilLoadmet,       // Heating Load Met
     385             :                                Optional<Real64 const> PartLoadFrac = _);
     386             : 
     387             : } // namespace HVACMultiSpeedHeatPump
     388             : 
     389        1542 : struct HVACMultiSpeedHeatPumpData : BaseGlobalStruct
     390             : {
     391             : 
     392             :     int NumMSHeatPumps = 0;     // Number of multi speed heat pumps
     393             :     int AirLoopPass = 0;        // Number of air loop pass
     394             :     Real64 TempSteamIn = 100.0; // steam coil steam inlet temperature
     395             : 
     396             :     std::string CurrentModuleObject; // Object type for getting and error messages
     397             :     Real64 CompOnMassFlow = 0.0;     // System air mass flow rate w/ compressor ON
     398             :     Real64 CompOffMassFlow = 0.0;    // System air mass flow rate w/ compressor OFF
     399             :     Real64 CompOnFlowRatio = 0.0;    // fan flow ratio when coil on
     400             :     Real64 CompOffFlowRatio = 0.0;   // fan flow ratio when coil off
     401             :     Real64 FanSpeedRatio = 0.0;      // fan speed ratio passed to on/off fan object
     402             :     Real64 SupHeaterLoad = 0.0;      // load to be met by supplemental heater [W]
     403             :     Real64 SaveLoadResidual = 0.0;   // Saved load residual used to check convergence
     404             :     Real64 SaveCompressorPLR = 0.0;  // holds compressor PLR from active DX coil
     405             :     Array1D_bool CheckEquipName;
     406             : 
     407             :     // SUBROUTINE SPECIFICATIONS FOR MODULE
     408             : 
     409             :     // Object Data
     410             :     Array1D<HVACMultiSpeedHeatPump::MSHeatPumpData> MSHeatPump;
     411             :     Array1D<HVACMultiSpeedHeatPump::MSHeatPumpReportData> MSHeatPumpReport;
     412             : 
     413             :     bool GetInputFlag = true;      // Get input flag
     414             :     bool FlowFracFlagReady = true; // one time flag for calculating flow fraction through controlled zone
     415             :     int ErrCountCyc = 0;           // Counter used to minimize the occurrence of output warnings
     416             :     int ErrCountVar = 0;           // Counter used to minimize the occurrence of output warnings
     417             : 
     418             :     std::string HeatCoilName; // TODO: What's the best plan here?
     419             : 
     420           0 :     void clear_state() override
     421             :     {
     422           0 :         this->NumMSHeatPumps = 0;
     423           0 :         this->AirLoopPass = 0;
     424           0 :         this->TempSteamIn = 100.0;
     425           0 :         this->CurrentModuleObject = "";
     426           0 :         this->CompOnMassFlow = 0.0;
     427           0 :         this->CompOffMassFlow = 0.0;
     428           0 :         this->CompOnFlowRatio = 0.0;
     429           0 :         this->CompOffFlowRatio = 0.0;
     430           0 :         this->FanSpeedRatio = 0.0;
     431           0 :         this->SupHeaterLoad = 0.0;
     432           0 :         this->SaveLoadResidual = 0.0;
     433           0 :         this->SaveCompressorPLR = 0.0;
     434           0 :         this->CheckEquipName.clear();
     435           0 :         this->MSHeatPump.clear();
     436           0 :         this->MSHeatPumpReport.clear();
     437           0 :         this->GetInputFlag = true; // Get input flag
     438           0 :         this->FlowFracFlagReady = true;
     439           0 :         this->ErrCountCyc = 0;
     440           0 :         this->ErrCountVar = 0;
     441           0 :         this->HeatCoilName = "";
     442           0 :     }
     443             : };
     444             : 
     445             : } // namespace EnergyPlus
     446             : 
     447             : #endif

Generated by: LCOV version 1.13