src/model/SimulationControl.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_SIMULATIONCONTROL_HPP | ||
| 7 | #define MODEL_SIMULATIONCONTROL_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ParentObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | namespace model { | ||
| 15 | |||
| 16 | class ConvergenceLimits; | ||
| 17 | class HeatBalanceAlgorithm; | ||
| 18 | class InsideSurfaceConvectionAlgorithm; | ||
| 19 | class OutsideSurfaceConvectionAlgorithm; | ||
| 20 | class RunPeriod; | ||
| 21 | class ShadowCalculation; | ||
| 22 | class SizingParameters; | ||
| 23 | class Timestep; | ||
| 24 | class ZoneAirContaminantBalance; | ||
| 25 | class ZoneAirHeatBalanceAlgorithm; | ||
| 26 | class ZoneAirMassFlowConservation; | ||
| 27 | class ZoneCapacitanceMultiplierResearchSpecial; | ||
| 28 | |||
| 29 | namespace detail { | ||
| 30 | class SimulationControl_Impl; | ||
| 31 | } | ||
| 32 | |||
| 33 | /** SimulationControl derives from ParentObject and is an interface to the OpenStudio IDD object named "SimulationControl". | ||
| 34 | * | ||
| 35 | * SimulationControl defines what types of sizing simulations are performed for an EnergyPlus simulation, | ||
| 36 | * it also controls whether or not to report results from sizing and weather file simulations. | ||
| 37 | * SimulationControl parents several other ModelObject types that configure simulation parameters for EnergyPlus. | ||
| 38 | * SimulationControl does not have a public constructor because it is a unique ModelObject. | ||
| 39 | * To get the SimulationControl object for a Model or create one if it does not yet exist use model.getUniqueObject<SimulationControl>(). | ||
| 40 | * To get the SimulationControl object for a Model but not create one if it does not yet exist use model.getOptionalUniqueObject<SimulationControl>(). | ||
| 41 | */ | ||
| 42 | class MODEL_API SimulationControl : public ParentObject | ||
| 43 | { | ||
| 44 | public: | ||
| 45 | 3597 | virtual ~SimulationControl() override = default; | |
| 46 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 47 | 285 | SimulationControl(const SimulationControl& other) = default; | |
| 48 | 1122 | SimulationControl(SimulationControl&& other) = default; | |
| 49 | ✗ | SimulationControl& operator=(const SimulationControl&) = default; | |
| 50 | ✗ | SimulationControl& operator=(SimulationControl&&) = default; | |
| 51 | |||
| 52 | //@} | ||
| 53 | /** @name Static Methods */ | ||
| 54 | //@{ | ||
| 55 | static IddObjectType iddObjectType(); | ||
| 56 | |||
| 57 | static std::vector<std::string> validSolarDistributionValues(); | ||
| 58 | |||
| 59 | //@} | ||
| 60 | /** @name Getters */ | ||
| 61 | //@{ | ||
| 62 | |||
| 63 | // When defaulted, this will return true if you have DesignDays in your model and any zone with a Zonal HVAC equipment, false otherwise | ||
| 64 | bool doZoneSizingCalculation() const; | ||
| 65 | |||
| 66 | bool isDoZoneSizingCalculationDefaulted() const; | ||
| 67 | |||
| 68 | // When defaulted, this will return true only if you have DesignDays and at least one AirLoopHVAC in your model | ||
| 69 | bool doSystemSizingCalculation() const; | ||
| 70 | |||
| 71 | bool isDoSystemSizingCalculationDefaulted() const; | ||
| 72 | |||
| 73 | // When defaulted, this will return true only if you have DesignDays and at least one PlantLoop in your model | ||
| 74 | bool doPlantSizingCalculation() const; | ||
| 75 | |||
| 76 | bool isDoPlantSizingCalculationDefaulted() const; | ||
| 77 | |||
| 78 | bool runSimulationforSizingPeriods() const; | ||
| 79 | |||
| 80 | bool isRunSimulationforSizingPeriodsDefaulted() const; | ||
| 81 | |||
| 82 | bool runSimulationforWeatherFileRunPeriods() const; | ||
| 83 | |||
| 84 | bool isRunSimulationforWeatherFileRunPeriodsDefaulted() const; | ||
| 85 | |||
| 86 | double loadsConvergenceToleranceValue() const; | ||
| 87 | |||
| 88 | bool isLoadsConvergenceToleranceValueDefaulted() const; | ||
| 89 | |||
| 90 | double temperatureConvergenceToleranceValue() const; | ||
| 91 | |||
| 92 | bool isTemperatureConvergenceToleranceValueDefaulted() const; | ||
| 93 | |||
| 94 | std::string solarDistribution() const; | ||
| 95 | |||
| 96 | bool isSolarDistributionDefaulted() const; | ||
| 97 | |||
| 98 | int maximumNumberofWarmupDays() const; | ||
| 99 | |||
| 100 | bool isMaximumNumberofWarmupDaysDefaulted() const; | ||
| 101 | |||
| 102 | int minimumNumberofWarmupDays() const; | ||
| 103 | |||
| 104 | bool isMinimumNumberofWarmupDaysDefaulted() const; | ||
| 105 | |||
| 106 | // When defaulted, this will return true only if you have DesignDays and at least one PlantLoop with a Sizing Plant having a 'Coincident' Sizing Option | ||
| 107 | bool doHVACSizingSimulationforSizingPeriods() const; | ||
| 108 | bool isDoHVACSizingSimulationforSizingPeriodsDefaulted() const; | ||
| 109 | |||
| 110 | int maximumNumberofHVACSizingSimulationPasses() const; | ||
| 111 | bool isMaximumNumberofHVACSizingSimulationPassesDefaulted() const; | ||
| 112 | |||
| 113 | //@} | ||
| 114 | /** @name Setters */ | ||
| 115 | //@{ | ||
| 116 | |||
| 117 | bool setDoZoneSizingCalculation(bool doZoneSizingCalculation); | ||
| 118 | |||
| 119 | void setDoZoneSizingCalculationNoFail(bool doZoneSizingCalculation); | ||
| 120 | |||
| 121 | void resetDoZoneSizingCalculation(); | ||
| 122 | |||
| 123 | bool setDoSystemSizingCalculation(bool doSystemSizingCalculation); | ||
| 124 | |||
| 125 | void setDoSystemSizingCalculationNoFail(bool doSystemSizingCalculation); | ||
| 126 | |||
| 127 | void resetDoSystemSizingCalculation(); | ||
| 128 | |||
| 129 | bool setDoPlantSizingCalculation(bool doPlantSizingCalculation); | ||
| 130 | |||
| 131 | void setDoPlantSizingCalculationNoFail(bool doPlantSizingCalculation); | ||
| 132 | |||
| 133 | void resetDoPlantSizingCalculation(); | ||
| 134 | |||
| 135 | bool setRunSimulationforSizingPeriods(bool runSimulationforSizingPeriods); | ||
| 136 | |||
| 137 | void setRunSimulationforSizingPeriodsNoFail(bool runSimulationforSizingPeriods); | ||
| 138 | |||
| 139 | void resetRunSimulationforSizingPeriods(); | ||
| 140 | |||
| 141 | bool setRunSimulationforWeatherFileRunPeriods(bool runSimulationforWeatherFileRunPeriods); | ||
| 142 | |||
| 143 | void setRunSimulationforWeatherFileRunPeriodsNoFail(bool runSimulationforWeatherFileRunPeriods); | ||
| 144 | |||
| 145 | void resetRunSimulationforWeatherFileRunPeriods(); | ||
| 146 | |||
| 147 | bool setLoadsConvergenceToleranceValue(double loadsConvergenceToleranceValue); | ||
| 148 | |||
| 149 | void resetLoadsConvergenceToleranceValue(); | ||
| 150 | |||
| 151 | bool setTemperatureConvergenceToleranceValue(double temperatureConvergenceToleranceValue); | ||
| 152 | |||
| 153 | void resetTemperatureConvergenceToleranceValue(); | ||
| 154 | |||
| 155 | bool setSolarDistribution(const std::string& solarDistribution); | ||
| 156 | |||
| 157 | void resetSolarDistribution(); | ||
| 158 | |||
| 159 | bool setMaximumNumberofWarmupDays(int maximumNumberofWarmupDays); | ||
| 160 | |||
| 161 | void resetMaximumNumberofWarmupDays(); | ||
| 162 | |||
| 163 | bool setMinimumNumberofWarmupDays(int minimumNumberofWarmupDays); | ||
| 164 | |||
| 165 | void resetMinimumNumberofWarmupDays(); | ||
| 166 | |||
| 167 | bool setDoHVACSizingSimulationforSizingPeriods(bool doHVACSizingSimulationforSizingPeriods); | ||
| 168 | void setDoHVACSizingSimulationforSizingPeriodsNoFail(bool doHVACSizingSimulationforSizingPeriods); | ||
| 169 | void resetDoHVACSizingSimulationforSizingPeriods(); | ||
| 170 | |||
| 171 | bool setMaximumNumberofHVACSizingSimulationPasses(int maximumNumberofHVACSizingSimulationPasses); | ||
| 172 | void resetMaximumNumberofHVACSizingSimulationPasses(); | ||
| 173 | |||
| 174 | //@} | ||
| 175 | |||
| 176 | /// Returns child ConvergenceLimits if it exists. | ||
| 177 | boost::optional<ConvergenceLimits> convergenceLimits() const; | ||
| 178 | |||
| 179 | /// Returns child HeatBalanceAlgorithm if it exists. | ||
| 180 | boost::optional<HeatBalanceAlgorithm> heatBalanceAlgorithm() const; | ||
| 181 | |||
| 182 | /// Returns child InsideSurfaceConvectionAlgorithm if it exists. | ||
| 183 | boost::optional<InsideSurfaceConvectionAlgorithm> insideSurfaceConvectionAlgorithm() const; | ||
| 184 | |||
| 185 | /// Returns child OutsideSurfaceConvectionAlgorithm if it exists. | ||
| 186 | boost::optional<OutsideSurfaceConvectionAlgorithm> outsideSurfaceConvectionAlgorithm() const; | ||
| 187 | |||
| 188 | /// Returns all children of type RunPeriod. | ||
| 189 | std::vector<RunPeriod> runPeriods() const; | ||
| 190 | |||
| 191 | /// Returns child ShadowCalculation if it exists. | ||
| 192 | boost::optional<ShadowCalculation> shadowCalculation() const; | ||
| 193 | |||
| 194 | /** Returns the SizingParameters object if it exists. */ | ||
| 195 | boost::optional<SizingParameters> sizingParameters() const; | ||
| 196 | |||
| 197 | /// Returns child Timestep if it exists. | ||
| 198 | boost::optional<Timestep> timestep() const; | ||
| 199 | |||
| 200 | /// Returns child ZoneAirContaminantBalance if it exists. | ||
| 201 | boost::optional<ZoneAirContaminantBalance> zoneAirContaminantBalance() const; | ||
| 202 | |||
| 203 | /// Returns child ZoneAirHeatBalanceAlgorithm if it exists. | ||
| 204 | boost::optional<ZoneAirHeatBalanceAlgorithm> zoneAirHeatBalanceAlgorithm() const; | ||
| 205 | |||
| 206 | /// Returns child ZoneAirMassFlowConservation object if it exists. | ||
| 207 | boost::optional<ZoneAirMassFlowConservation> zoneAirMassFlowConservation() const; | ||
| 208 | |||
| 209 | /// Returns child ZoneCapacitanceMultiplierResearchSpecial if it exists. | ||
| 210 | boost::optional<ZoneCapacitanceMultiplierResearchSpecial> zoneCapacitanceMultiplierResearchSpecial() const; | ||
| 211 | |||
| 212 | /** Returns the SqlFile environment period strings that correspond to sizing periods. */ | ||
| 213 | std::vector<std::string> sizingEnvironmentPeriods() const; | ||
| 214 | |||
| 215 | /** Returns the SqlFile environment period strings that correspond to single-year annual | ||
| 216 | * simulations. */ | ||
| 217 | std::vector<std::string> annualSimulationEnvironmentPeriods() const; | ||
| 218 | |||
| 219 | /** Returns the SqlFile environment period strings that correspond to partial-year, | ||
| 220 | * non-sizing simulations. */ | ||
| 221 | std::vector<std::string> partialYearEnvironmentPeriods() const; | ||
| 222 | |||
| 223 | /** Returns the SqlFile environment period strings that correspond to non-sizing simulations | ||
| 224 | * with repeated run periods. (Multi-year, or repeated partial years.) */ | ||
| 225 | std::vector<std::string> repeatedIntervalEnvironmentPeriods() const; | ||
| 226 | |||
| 227 | protected: | ||
| 228 | /** @name Constructors and Destructors */ | ||
| 229 | //@{ | ||
| 230 | |||
| 231 | /// Constructs a new SimulationControl object in the model. | ||
| 232 | explicit SimulationControl(const Model& model); | ||
| 233 | |||
| 234 | //@} | ||
| 235 | |||
| 236 | /// @cond | ||
| 237 | |||
| 238 | friend class detail::SimulationControl_Impl; | ||
| 239 | friend class Model; | ||
| 240 | friend class IdfObject; | ||
| 241 | friend class openstudio::detail::IdfObject_Impl; | ||
| 242 | |||
| 243 | using ImplType = detail::SimulationControl_Impl; | ||
| 244 | |||
| 245 | explicit SimulationControl(std::shared_ptr<ImplType> impl); | ||
| 246 | |||
| 247 | private: | ||
| 248 | REGISTER_LOGGER("openstudio.model.SimulationControl"); | ||
| 249 | |||
| 250 | /// @endcond | ||
| 251 | }; | ||
| 252 | |||
| 253 | /** \relates SimulationControl */ | ||
| 254 | using OptionalSimulationControl = boost::optional<SimulationControl>; | ||
| 255 | |||
| 256 | } // namespace model | ||
| 257 | } // namespace openstudio | ||
| 258 | |||
| 259 | #endif | ||
| 260 |