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 ENERGYPLUS_COILS_COILCOOLINGDX
49 : #define ENERGYPLUS_COILS_COILCOOLINGDX
50 :
51 : #include <string>
52 : #include <vector>
53 :
54 : #include <EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh>
55 : #include <EnergyPlus/Data/BaseData.hh>
56 : #include <EnergyPlus/DataHeatBalance.hh>
57 : #include <EnergyPlus/EnergyPlus.hh>
58 :
59 : namespace EnergyPlus {
60 :
61 : // Forward declarations
62 : struct EnergyPlusData;
63 :
64 469 : struct CoilCoolingDXInputSpecification
65 : {
66 : std::string name;
67 : std::string evaporator_inlet_node_name;
68 : std::string evaporator_outlet_node_name;
69 : std::string availability_schedule_name;
70 : std::string condenser_zone_name;
71 : std::string condenser_inlet_node_name;
72 : std::string condenser_outlet_node_name;
73 : std::string performance_object_name;
74 : std::string condensate_collection_water_storage_tank_name;
75 : std::string evaporative_condenser_supply_water_storage_tank_name;
76 : };
77 :
78 265 : struct CoilCoolingDX
79 : {
80 51 : CoilCoolingDX() = default;
81 : static int factory(EnergyPlusData &state, std::string const &coilName);
82 : static void getInput(EnergyPlusData &state);
83 : static void clear_state();
84 : static void reportAllStandardRatings(EnergyPlusData &state);
85 : void instantiateFromInputSpec(EnergyPlusData &state, const CoilCoolingDXInputSpecification &input_data);
86 : void oneTimeInit(EnergyPlusData &state);
87 : void simulate(EnergyPlusData &state,
88 : int useAlternateMode,
89 : Real64 PLR,
90 : int speedNum,
91 : Real64 speedRatio,
92 : int const fanOpMode,
93 : bool const singleMode,
94 : Real64 LoadSHR = -1.0);
95 : void setData(int fanIndex, int fanType, std::string const &fanName, int airLoopNum);
96 : void getFixedData(int &evapInletNodeIndex,
97 : int &evapOutletNodeIndex,
98 : int &condInletNodeIndex,
99 : int &normalModeNumSpeeds,
100 : CoilCoolingDXCurveFitPerformance::CapControlMethod &capacityControlMethod,
101 : Real64 &minOutdoorDryBulb);
102 : void getDataAfterSizing(Real64 &normalModeRatedEvapAirFlowRate,
103 : Real64 &normalModeRatedCapacity,
104 : std::vector<Real64> &normalModeFlowRates,
105 : std::vector<Real64> &normalModeRatedCapacities);
106 : static void inline passThroughNodeData(DataLoopNode::NodeData &in, DataLoopNode::NodeData &out);
107 : void size(EnergyPlusData &state);
108 :
109 : int getNumModes();
110 : int getOpModeCapFTIndex(bool useAlternateMode = false);
111 : Real64 condMassFlowRate(bool useAlternateMode);
112 :
113 : CoilCoolingDXInputSpecification original_input_specs;
114 : std::string name;
115 : bool myOneTimeInitFlag = true;
116 : int evapInletNodeIndex = 0;
117 : int evapOutletNodeIndex = 0;
118 : int availScheduleIndex = 0;
119 : int condInletNodeIndex = 0;
120 : int condOutletNodeIndex = 0;
121 : CoilCoolingDXCurveFitPerformance performance;
122 : int condensateTankIndex = 0;
123 : int condensateTankSupplyARRID = 0;
124 : Real64 condensateVolumeFlow = 0.0;
125 : Real64 condensateVolumeConsumption = 0.0;
126 : int evaporativeCondSupplyTankIndex = 0;
127 : int evaporativeCondSupplyTankARRID = 0;
128 : Real64 evaporativeCondSupplyTankVolumeFlow = 0.0;
129 : Real64 evaporativeCondSupplyTankConsump = 0.0;
130 : Real64 evapCondPumpElecPower = 0.0;
131 : Real64 evapCondPumpElecConsumption = 0.0;
132 : int airLoopNum = 0; // Add for AFN compatibility, revisit at a later date
133 : int supplyFanIndex = 0;
134 : int supplyFanType = 0;
135 : std::string supplyFanName = "";
136 : bool SubcoolReheatFlag = false; // Subcool reheat coil control
137 :
138 : CoilCoolingDXCurveFitSpeed &normModeNomSpeed();
139 : CoilCoolingDXCurveFitSpeed &altModeNomSpeed();
140 :
141 : // report variables
142 : Real64 totalCoolingEnergyRate = 0.0;
143 : Real64 totalCoolingEnergy = 0.0;
144 : Real64 sensCoolingEnergyRate = 0.0;
145 : Real64 sensCoolingEnergy = 0.0;
146 : Real64 latCoolingEnergyRate = 0.0;
147 : Real64 latCoolingEnergy = 0.0;
148 :
149 : Real64 coolingCoilRuntimeFraction = 0.0;
150 : Real64 elecCoolingPower = 0.0;
151 : Real64 elecCoolingConsumption = 0.0;
152 :
153 : Real64 airMassFlowRate = 0.0;
154 : Real64 inletAirDryBulbTemp = 0.0;
155 : Real64 inletAirHumRat = 0.0;
156 : Real64 outletAirDryBulbTemp = 0.0;
157 : Real64 outletAirHumRat = 0.0;
158 : Real64 partLoadRatioReport = 0.0;
159 : Real64 runTimeFraction = 0.0;
160 : int speedNumReport = 0;
161 : Real64 speedRatioReport = 0.0;
162 : Real64 wasteHeatEnergyRate = 0.0;
163 : Real64 wasteHeatEnergy = 0.0;
164 : Real64 recoveredHeatEnergy = 0.0;
165 : Real64 recoveredHeatEnergyRate = 0.0;
166 : Real64 condenserInletTemperature = 0.0;
167 : int dehumidificationMode = 0;
168 : bool reportCoilFinalSizes = true;
169 : bool isSecondaryDXCoilInZone = false;
170 : Real64 secCoilSensHeatRejEnergyRate = 0.0;
171 : Real64 secCoilSensHeatRejEnergy = 0.0;
172 : EnergyPlus::DataHeatBalance::HeatReclaimDataBase reclaimHeat;
173 :
174 : void setToHundredPercentDOAS();
175 : bool isHundredPercentDOAS = false;
176 : };
177 :
178 1542 : struct CoilCoolingDXData : BaseGlobalStruct
179 : {
180 : std::vector<CoilCoolingDX> coilCoolingDXs;
181 : bool coilCoolingDXGetInputFlag = true;
182 : std::string const coilCoolingDXObjectName = "Coil:Cooling:DX";
183 : bool stillNeedToReportStandardRatings = true; // standard ratings flag for all coils to report at the same time
184 0 : void clear_state() override
185 : {
186 0 : coilCoolingDXs.clear();
187 0 : coilCoolingDXGetInputFlag = true;
188 0 : stillNeedToReportStandardRatings = true;
189 0 : }
190 : };
191 :
192 : } // namespace EnergyPlus
193 :
194 : #endif // ENERGYPLUS_COILS_COILCOOLINGDX
|