src/model/FanSystemModel_Impl.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef MODEL_FANSYSTEMMODEL_IMPL_HPP | ||
| 7 | #define MODEL_FANSYSTEMMODEL_IMPL_HPP | ||
| 8 | |||
| 9 | #include <model/ModelAPI.hpp> | ||
| 10 | #include "StraightComponent_Impl.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class Schedule; | ||
| 16 | class Curve; | ||
| 17 | class ThermalZone; | ||
| 18 | class FanSystemModelSpeed; | ||
| 19 | class AirflowNetworkFan; | ||
| 20 | |||
| 21 | namespace detail { | ||
| 22 | |||
| 23 | /** FanSystemModel_Impl is a StraightComponent_Impl that is the implementation class for FanSystemModel.*/ | ||
| 24 | class MODEL_API FanSystemModel_Impl : public StraightComponent_Impl | ||
| 25 | { | ||
| 26 | public: | ||
| 27 | /** @name Constructors and Destructors */ | ||
| 28 | //@{ | ||
| 29 | |||
| 30 | FanSystemModel_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 31 | |||
| 32 | FanSystemModel_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 33 | |||
| 34 | FanSystemModel_Impl(const FanSystemModel_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 35 | |||
| 36 | 119 | virtual ~FanSystemModel_Impl() override = default; | |
| 37 | |||
| 38 | //@} | ||
| 39 | /** @name Virtual Methods */ | ||
| 40 | //@{ | ||
| 41 | |||
| 42 | virtual const std::vector<std::string>& outputVariableNames() const override; | ||
| 43 | |||
| 44 | virtual IddObjectType iddObjectType() const override; | ||
| 45 | |||
| 46 | virtual std::vector<ScheduleTypeKey> getScheduleTypeKeys(const Schedule& schedule) const override; | ||
| 47 | |||
| 48 | virtual std::vector<ModelObject> children() const override; | ||
| 49 | |||
| 50 | virtual unsigned inletPort() const override; | ||
| 51 | |||
| 52 | virtual unsigned outletPort() const override; | ||
| 53 | |||
| 54 | virtual bool addToNode(Node& node) override; | ||
| 55 | |||
| 56 | virtual void autosize() override; | ||
| 57 | |||
| 58 | virtual void applySizingValues() override; | ||
| 59 | |||
| 60 | virtual ComponentType componentType() const override; | ||
| 61 | virtual std::vector<FuelType> coolingFuelTypes() const override; | ||
| 62 | virtual std::vector<FuelType> heatingFuelTypes() const override; | ||
| 63 | virtual std::vector<AppGFuelType> appGHeatingFuelTypes() const override; | ||
| 64 | |||
| 65 | //@} | ||
| 66 | /** @name Getters */ | ||
| 67 | //@{ | ||
| 68 | |||
| 69 | Schedule availabilitySchedule() const; | ||
| 70 | |||
| 71 | boost::optional<double> designMaximumAirFlowRate() const; | ||
| 72 | |||
| 73 | bool isDesignMaximumAirFlowRateAutosized() const; | ||
| 74 | |||
| 75 | boost::optional<double> autosizedDesignMaximumAirFlowRate(); | ||
| 76 | |||
| 77 | std::string speedControlMethod() const; | ||
| 78 | |||
| 79 | double electricPowerMinimumFlowRateFraction() const; | ||
| 80 | |||
| 81 | double designPressureRise() const; | ||
| 82 | |||
| 83 | double motorEfficiency() const; | ||
| 84 | |||
| 85 | double motorInAirStreamFraction() const; | ||
| 86 | |||
| 87 | boost::optional<double> designElectricPowerConsumption() const; | ||
| 88 | |||
| 89 | bool isDesignElectricPowerConsumptionAutosized() const; | ||
| 90 | |||
| 91 | boost::optional<double> autosizedDesignElectricPowerConsumption(); | ||
| 92 | |||
| 93 | std::string designPowerSizingMethod() const; | ||
| 94 | |||
| 95 | double electricPowerPerUnitFlowRate() const; | ||
| 96 | |||
| 97 | double electricPowerPerUnitFlowRatePerUnitPressure() const; | ||
| 98 | |||
| 99 | double fanTotalEfficiency() const; | ||
| 100 | |||
| 101 | boost::optional<Curve> electricPowerFunctionofFlowFractionCurve() const; | ||
| 102 | |||
| 103 | boost::optional<double> nightVentilationModePressureRise() const; | ||
| 104 | |||
| 105 | boost::optional<double> nightVentilationModeFlowFraction() const; | ||
| 106 | |||
| 107 | boost::optional<ThermalZone> motorLossZone() const; | ||
| 108 | |||
| 109 | double motorLossRadiativeFraction() const; | ||
| 110 | |||
| 111 | std::string endUseSubcategory() const; | ||
| 112 | |||
| 113 | unsigned numberofSpeeds() const; | ||
| 114 | std::vector<FanSystemModelSpeed> speeds() const; | ||
| 115 | |||
| 116 | /** Find a given speed by the flowFraction (key) */ | ||
| 117 | boost::optional<unsigned> speedIndex(const FanSystemModelSpeed& speed) const; | ||
| 118 | |||
| 119 | boost::optional<FanSystemModelSpeed> getSpeed(unsigned speedIndex) const; | ||
| 120 | |||
| 121 | //@} | ||
| 122 | /** @name Setters */ | ||
| 123 | //@{ | ||
| 124 | |||
| 125 | /** If a speed group is already present (= the flowFraction already exists) (cf `speedIndex()`), it will Warn and override the electricPowerFraction value */ | ||
| 126 | bool addSpeed(const FanSystemModelSpeed& speed); | ||
| 127 | |||
| 128 | // Overloads, it creates a FanSystemModelSpeed wrapper, then call `addSpeed(const FanSystemModelSpeed&)` | ||
| 129 | bool addSpeed(double flowFraction); | ||
| 130 | bool addSpeed(double flowFraction, double electricPowerFraction); | ||
| 131 | |||
| 132 | bool removeSpeed(unsigned speedIndex); | ||
| 133 | |||
| 134 | void removeAllSpeeds(); | ||
| 135 | |||
| 136 | // Directly set the speeds from a vector, will delete any existing speeds | ||
| 137 | bool setSpeeds(const std::vector<FanSystemModelSpeed>& speeds); | ||
| 138 | |||
| 139 | bool setAvailabilitySchedule(Schedule& schedule); | ||
| 140 | |||
| 141 | bool setDesignMaximumAirFlowRate(double designMaximumAirFlowRate); | ||
| 142 | |||
| 143 | void autosizeDesignMaximumAirFlowRate(); | ||
| 144 | |||
| 145 | bool setSpeedControlMethod(const std::string& speedControlMethod); | ||
| 146 | |||
| 147 | bool setElectricPowerMinimumFlowRateFraction(double electricPowerMinimumFlowRateFraction); | ||
| 148 | |||
| 149 | bool setDesignPressureRise(double designPressureRise); | ||
| 150 | |||
| 151 | bool setMotorEfficiency(double motorEfficiency); | ||
| 152 | |||
| 153 | bool setMotorInAirStreamFraction(double motorInAirStreamFraction); | ||
| 154 | |||
| 155 | bool setDesignElectricPowerConsumption(double designElectricPowerConsumption); | ||
| 156 | |||
| 157 | void autosizeDesignElectricPowerConsumption(); | ||
| 158 | |||
| 159 | bool setDesignPowerSizingMethod(const std::string& designPowerSizingMethod); | ||
| 160 | |||
| 161 | bool setElectricPowerPerUnitFlowRate(double electricPowerPerUnitFlowRate); | ||
| 162 | |||
| 163 | bool setElectricPowerPerUnitFlowRatePerUnitPressure(double electricPowerPerUnitFlowRatePerUnitPressure); | ||
| 164 | |||
| 165 | bool setFanTotalEfficiency(double fanTotalEfficiency); | ||
| 166 | |||
| 167 | bool setElectricPowerFunctionofFlowFractionCurve(const Curve& univariateFunctions); | ||
| 168 | |||
| 169 | void resetElectricPowerFunctionofFlowFractionCurve(); | ||
| 170 | |||
| 171 | bool setNightVentilationModePressureRise(double nightVentilationModePressureRise); | ||
| 172 | |||
| 173 | void resetNightVentilationModePressureRise(); | ||
| 174 | |||
| 175 | bool setNightVentilationModeFlowFraction(double nightVentilationModeFlowFraction); | ||
| 176 | |||
| 177 | void resetNightVentilationModeFlowFraction(); | ||
| 178 | |||
| 179 | bool setMotorLossZone(const ThermalZone& thermalZone); | ||
| 180 | |||
| 181 | void resetMotorLossZone(); | ||
| 182 | |||
| 183 | bool setMotorLossRadiativeFraction(double motorLossRadiativeFraction); | ||
| 184 | |||
| 185 | bool setEndUseSubcategory(const std::string& endUseSubcategory); | ||
| 186 | |||
| 187 | //@} | ||
| 188 | /** @name Other */ | ||
| 189 | //@{ | ||
| 190 | |||
| 191 | AirflowNetworkFan getAirflowNetworkFan(); | ||
| 192 | boost::optional<AirflowNetworkFan> airflowNetworkFan() const; | ||
| 193 | |||
| 194 | //@} | ||
| 195 | protected: | ||
| 196 | private: | ||
| 197 | − | REGISTER_LOGGER("openstudio.model.FanSystemModel"); | |
| 198 | |||
| 199 | boost::optional<Schedule> optionalAvailabilitySchedule() const; | ||
| 200 | |||
| 201 | virtual boost::optional<ZoneHVACComponent> containingZoneHVACComponent() const override; | ||
| 202 | |||
| 203 | virtual boost::optional<HVACComponent> containingHVACComponent() const override; | ||
| 204 | |||
| 205 | bool addSpeedPrivate(double flowFraction, boost::optional<double> electricPowerFraction); | ||
| 206 | }; | ||
| 207 | |||
| 208 | } // namespace detail | ||
| 209 | |||
| 210 | } // namespace model | ||
| 211 | } // namespace openstudio | ||
| 212 | |||
| 213 | #endif // MODEL_FANSYSTEMMODEL_IMPL_HPP | ||
| 214 |