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 PlantTopologyComponent_hh_INCLUDED
49 : #define PlantTopologyComponent_hh_INCLUDED
50 :
51 : #include <EnergyPlus/DataBranchAirLoopPlant.hh>
52 : #include <EnergyPlus/Plant/Enums.hh>
53 : #include <EnergyPlus/Plant/EquipAndOperations.hh>
54 : #include <EnergyPlus/Plant/PlantLocation.hh>
55 : #include <EnergyPlus/PlantComponent.hh>
56 :
57 : namespace EnergyPlus {
58 :
59 : // Forward declarations
60 : struct EnergyPlusData;
61 :
62 : namespace DataPlant {
63 :
64 : static constexpr std::array<bool, static_cast<int>(PlantEquipmentType::Num)> PlantEquipmentTypeIsPump = {
65 : false, // "Boiler:HotWater"
66 : false, // "Boiler:Steam"
67 : false, // "Chiller:Absorption"
68 : false, // "Chiller:Absorption:Indirect"
69 : false, // "Chiller:CombustionTurbine"
70 : false, // "Chiller:ConstantCOP"
71 : false, // "ChillerHeater:Absorption:DirectFired"
72 : false, // "Chiller:Electric"
73 : false, // "Chiller:Electric:EIR"
74 : false, // "Chiller:Electric:ReformulatedEIR"
75 : false, // "Chiller:Electric:ASHRAE205"
76 : false, // "Chiller:EngineDriven"
77 : false, // "CoolingTower:SingleSpeed"
78 : false, // "CoolingTower:TwoSpeed"
79 : false, // "CoolingTower:VariableSpeed"
80 : false, // "Generator:Fuelcell:ExhaustGastoWaterHeatExchanger"
81 : false, // "WaterHeater:HeatPump:PumpedCondenser"
82 : false, // "Heatpump:WatertoWater:Equationfit:Cooling"
83 : false, // "Heatpump:WatertoWater:Equationfit:Heating"
84 : false, // "Heatpump:WatertoWater:ParameterEstimation:Cooling"
85 : false, // "Heatpump:WatertoWater:ParameterEstimation:Heating"
86 : false, // "Pipe:Adiabatic"
87 : false, // "Pipe:Adiabatic:Steam"
88 : false, // "Pipe:Outdoor"
89 : false, // "Pipe:Indoor"
90 : false, // "Pipe:Underground"
91 : false, // "DistrictCooling"
92 : false, // "DistrictHeating"
93 : false, // "ThermalStorage:Ice:Detailed"
94 : false, // "ThermalStorage:Ice:Simple"
95 : false, // "TemperingValve"
96 : false, // "WaterHeater:Mixed"
97 : false, // "WaterHeater:Stratified"
98 : true, // "Pump:VariableSpeed"
99 : true, // "Pump:ConstantSpeed"
100 : true, // "Pump:VariableSpeed:Condensate"
101 : true, // "HeaderedPumps:VariableSpeed"
102 : true, // "HeaderedPumps:ConstantSpeed"
103 : false, // "WaterUse:Connections"
104 : false, // "Coil:Cooling:Water"
105 : false, // "Coil:Cooling:Water:DetailedGeometry"
106 : false, // "Coil:Heating:Water"
107 : false, // "Coil:Heating:Steam"
108 : false, // "Solarcollector:Flatplate:Water"
109 : false, // "LoadProfile:Plant"
110 : false, // "GroundHeatExchanger:System"
111 : false, // "GroundHeatExchanger:Surface"
112 : false, // "GroundHeatExchanger:Pond"
113 : false, // "Generator:Microturbine"
114 : false, // "Generator:InternalCombustionEngine"
115 : false, // "Generator:CombustionTurbine"
116 : false, // "Generator:Microchp"
117 : false, // "Generator:Fuelcell:StackCooler"
118 : false, // "FluidCooler:SingleSpeed"
119 : false, // "FluidCooler:TwoSpeed"
120 : false, // "EvaporativeFluidCooler:SingleSpeed"
121 : false, // "EvaporativeFluidCooler:TwoSpeed"
122 : false, // "ThermalStorage:ChilledWater:Mixed"
123 : false, // "ThermalStorage:ChilledWater:Stratified"
124 : false, // "SolarCollector:FlatPlate:PhotovoltaicThermal"
125 : false, // "ZoneHVAC:Baseboard:Convective:Water"
126 : false, // "ZoneHVAC:Baseboard:RadiantConvective:Steam"
127 : false, // "ZoneHVAC:Baseboard:RadiantConvective:Water"
128 : false, // "ZoneHVAC:LowTemperatureRadiant:VariableFlow"
129 : false, // "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
130 : false, // "AirTerminal:SingleDuct:ConstantVolume:CooledBeam"
131 : false, // "Coil:Heating:WaterToAirHeatPump:EquationFit"
132 : false, // "Coil:Cooling:WaterToAirHeatPump:EquationFit"
133 : false, // "Coil:Heating:WaterToAirHeatPump:ParameterEstimation"
134 : false, // "Coil:Cooling:WaterToAirHeatPump:ParameterEstimation"
135 : false, // "Refrigeration:Condenser:WaterCooled"
136 : false, // "Refrigeration:CompressorRack"
137 : false, // "AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed"
138 : false, // "ChillerHeater:Absorption:DoubleEffect"
139 : false, // "PipingSystem:Underground:PipeCircuit"
140 : false, // "SolarCollector:IntegralCollectorStorage"
141 : false, // "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit"
142 : false, // "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit"
143 : false, // "PlantComponent:UserDefined"
144 : false, // "Coil:UserDefined"
145 : false, // "ZoneHVAC:ForcedAir:UserDefined"
146 : false, // "AirTerminal:SingleDuct:UserDefined"
147 : false, // "AirConditioner:VariableRefrigerantFlow"
148 : false, // "GroundHeatExchanger:HorizontalTrench"
149 : false, // "HeatExchanger:FluidToFluid"
150 : false, // "PlantComponent:TemperatureSource"
151 : false, // "CentralHeatPumpSystem"
152 : false, // "AirLoopHVAC:UnitarySystem"
153 : false, // "Coil:Cooling:DX:SingleSpeed:ThermalStorage"
154 : false, // "CoolingTower:VariableSpeed:Merkel"
155 : false, // "SwimmingPool:Indoor"
156 : false, // "GroundHeatExchanger:Slinky"
157 : false, // "WaterHeater:HeatPump:WrappedCondenser"
158 : false, // "AirTerminal:SingleDuct:ConstantVolume:FourPipeBeam"
159 : false, // "ZoneHVAC:CoolingPanel:RadiantConvective:Water"
160 : false, // "HeatPump:PlantLoop:EIR:Cooling"
161 : false // "HeatPump:PlantLoop:EIR:Heating"
162 : };
163 :
164 227300 : struct CompData
165 : {
166 : // Members
167 : std::string TypeOf; // The 'keyWord' identifying component type
168 : DataPlant::PlantEquipmentType Type; // Reference the "TypeOf" parameters in DataPlant
169 : std::string Name; // Component name
170 : int CompNum; // Component ID number
171 : DataBranchAirLoopPlant::ControlType FlowCtrl; // flow control for splitter/mixer (ACTIVE/PASSIVE/BYPASS)
172 : LoopFlowStatus FlowPriority; // status for overall loop flow determination
173 : bool ON; // TRUE = designated component or operation scheme available
174 : bool Available; // TRUE = designated component or operation scheme available
175 : std::string NodeNameIn; // Component inlet node name
176 : std::string NodeNameOut; // Component outlet node name
177 : int NodeNumIn; // Component inlet node number
178 : int NodeNumOut; // Component outlet node number
179 : Real64 MyLoad; // Distributed Load
180 : Real64 MaxLoad; // Maximum load
181 : Real64 MinLoad; // Minimum Load
182 : Real64 OptLoad; // Optimal Load
183 : Real64 SizFac; // Sizing Fraction
184 : DataPlant::OpScheme CurOpSchemeType; // updated pointer to
185 : // Plant()%OpScheme(CurOpSchemeType)...
186 : int NumOpSchemes; // number of schemes held in the pointer array
187 : int CurCompLevelOpNum; // pointer to the OpScheme array defined next
188 : // PlantLoop()%LoopSide()%Branch()%Comp()%OpScheme(curOpSchemePtr)
189 : Array1D<OpSchemePtrData> OpScheme; // Pointers to component on lists
190 : Real64 EquipDemand; // Component load request based on inlet temp and outlet SP
191 : bool EMSLoadOverrideOn; // EMS is calling to override load dispatched to component
192 : Real64 EMSLoadOverrideValue; // EMS value to use for load when overridden [W] always positive.
193 : DataPlant::HowMet HowLoadServed; // nature of component in terms of how it can meet load
194 : Real64 MinOutletTemp; // Component exit lower limit temperature
195 : Real64 MaxOutletTemp; // Component exit upper limit temperature
196 : bool FreeCoolCntrlShutDown; // true if component was shut down because of free cooling
197 : Real64 FreeCoolCntrlMinCntrlTemp; // current control temp value for free cooling controls
198 : DataPlant::FreeCoolControlMode FreeCoolCntrlMode; // type of sensor used for free cooling controls
199 : int FreeCoolCntrlNodeNum; // chiller condenser inlet node number for free cooling controls
200 : int IndexInLoopSidePumps; // If I'm a pump, this tells my index in PL(:)%LS(:)%Pumps
201 : Real64 TempDesCondIn;
202 : Real64 TempDesEvapOut;
203 : PlantComponent *compPtr;
204 : EnergyPlus::PlantLocation location;
205 :
206 : // Default Constructor
207 12878 : CompData()
208 12878 : : Type(DataPlant::PlantEquipmentType::Invalid), CompNum(0), FlowCtrl(DataBranchAirLoopPlant::ControlType::Invalid),
209 : FlowPriority(LoopFlowStatus::Invalid), ON(false), Available(false), NodeNumIn(0), NodeNumOut(0), MyLoad(0.0), MaxLoad(0.0),
210 : MinLoad(0.0), OptLoad(0.0), SizFac(0.0), CurOpSchemeType(DataPlant::OpScheme::Invalid), NumOpSchemes(0), CurCompLevelOpNum(0),
211 : EquipDemand(0.0), EMSLoadOverrideOn(false), EMSLoadOverrideValue(0.0), HowLoadServed(DataPlant::HowMet::Invalid), MinOutletTemp(0.0),
212 : MaxOutletTemp(0.0), FreeCoolCntrlShutDown(false), FreeCoolCntrlMinCntrlTemp(0.0),
213 : FreeCoolCntrlMode(DataPlant::FreeCoolControlMode::Invalid), FreeCoolCntrlNodeNum(0), IndexInLoopSidePumps(0), TempDesCondIn(0.0),
214 12878 : TempDesEvapOut(0.0), compPtr(nullptr)
215 : {
216 12878 : }
217 :
218 : void initLoopEquip(EnergyPlusData &state, bool const GetCompSizFac);
219 : // This function is called before the main simulation calls for component models when the plant sizing is being conducted. The
220 : // component model needs to be set up such that when this function is called, the getInput, initialization and sizing routines
221 : // are run, but the calculation routine does not. When called, most supply side component models need to return values for the
222 : // minimum, maximum, and optimal capacities (in terms of loop loads that the device can meet). For plant components with more
223 : // than one connection to a plant loop, a leading loop connection must be determined and the component sizing routine called
224 : // with initLoopEquip is called for only that plant loop. For a example, a chiller only calls its sizing routine when called
225 : // from a the chilled water loop and does not call it sizing routine when called from the condenser loop.
226 :
227 : void simulate(EnergyPlusData &state, bool FirstHVACIteration);
228 :
229 : void oneTimeInit(EnergyPlusData &state) const;
230 :
231 : static CompData &getPlantComponent(EnergyPlusData &state, PlantLocation const &plantLoc);
232 : };
233 : } // namespace DataPlant
234 : } // namespace EnergyPlus
235 :
236 : #endif
|