| 216 | } |
| 217 | |
| 218 | bool SimulationControl_Impl::doSystemSizingCalculation() const { |
| 219 | |
| 220 | auto shouldItBeOn = [this]() -> bool { |
| 221 | const auto m = model(); |
| 222 | return !m.getModelObjects<SizingPeriod>().empty() && !m.getConcreteModelObjects<AirLoopHVAC>().empty(); |
| 223 | }; |
| 224 | |
| 225 | if (!isDoSystemSizingCalculationDefaulted()) { |
| 226 | boost::optional<std::string> value = getString(OS_SimulationControlFields::DoSystemSizingCalculation, true); |
| 227 | OS_ASSERT(value); |
| 228 | const auto result = openstudio::istringEqual(value.get(), "Yes"); |
| 229 | if (!result && shouldItBeOn()) { |
| 230 | LOG(Warn, "You have AirLoopHVAC(s) and design day(s), it's possible you should enable SimulationControl::DoSystemSizingCalculation"); |
| 231 | } |
| 232 | return result; |
| 233 | } |
| 234 | |
| 235 | const auto result = shouldItBeOn(); |
| 236 | if (result) { |
| 237 | LOG(Debug, "You have AirLoopHVAC(s) and design day(s), and SimulationControl::DoSystemSizingCalculation is defaulted: assuming on."); |
| 238 | } |
| 239 | |
| 240 | return result; |
| 241 | } |
| 242 | |
| 243 | bool SimulationControl_Impl::isDoSystemSizingCalculationDefaulted() const { |
| 244 | return isEmpty(OS_SimulationControlFields::DoSystemSizingCalculation); |