src/sdd/ReverseTranslator.cpp
| 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 | #include "ReverseTranslator.hpp" | ||
| 7 | #include "Helpers.hpp" | ||
| 8 | |||
| 9 | #include "../model/Model.hpp" | ||
| 10 | #include "../model/Component.hpp" | ||
| 11 | #include "../model/ModelObject.hpp" | ||
| 12 | #include "../model/ModelObject_Impl.hpp" | ||
| 13 | #include "../model/Node.hpp" | ||
| 14 | #include "../model/Node_Impl.hpp" | ||
| 15 | #include "../model/AirLoopHVAC.hpp" | ||
| 16 | #include "../model/AirLoopHVAC_Impl.hpp" | ||
| 17 | #include "../model/AirLoopHVACOutdoorAirSystem.hpp" | ||
| 18 | #include "../model/AirLoopHVACOutdoorAirSystem_Impl.hpp" | ||
| 19 | #include "../model/AvailabilityManagerOptimumStart.hpp" | ||
| 20 | #include "../model/AvailabilityManagerOptimumStart_Impl.hpp" | ||
| 21 | #include "../model/AvailabilityManagerNightCycle.hpp" | ||
| 22 | #include "../model/AvailabilityManagerNightCycle_Impl.hpp" | ||
| 23 | #include "../model/HeatExchangerAirToAirSensibleAndLatent.hpp" | ||
| 24 | #include "../model/HeatExchangerAirToAirSensibleAndLatent_Impl.hpp" | ||
| 25 | #include "../model/Facility.hpp" | ||
| 26 | #include "../model/Facility_Impl.hpp" | ||
| 27 | #include "../model/FanZoneExhaust.hpp" | ||
| 28 | #include "../model/FanZoneExhaust_Impl.hpp" | ||
| 29 | #include "../model/Building.hpp" | ||
| 30 | #include "../model/Building_Impl.hpp" | ||
| 31 | #include "../model/ThermalZone.hpp" | ||
| 32 | #include "../model/ThermalZone_Impl.hpp" | ||
| 33 | #include "../model/ShadingSurfaceGroup.hpp" | ||
| 34 | #include "../model/ShadingSurfaceGroup_Impl.hpp" | ||
| 35 | #include "../model/Site.hpp" | ||
| 36 | #include "../model/Site_Impl.hpp" | ||
| 37 | #include "../model/WeatherFile.hpp" | ||
| 38 | #include "../model/WeatherFile_Impl.hpp" | ||
| 39 | #include "../model/Construction.hpp" | ||
| 40 | #include "../model/SimpleGlazing.hpp" | ||
| 41 | #include "../model/StandardOpaqueMaterial.hpp" | ||
| 42 | #include "../model/PlantLoop.hpp" | ||
| 43 | #include "../model/PlantLoop_Impl.hpp" | ||
| 44 | #include "../model/Timestep.hpp" | ||
| 45 | #include "../model/Timestep_Impl.hpp" | ||
| 46 | #include "../model/OutputVariable.hpp" | ||
| 47 | #include "../model/SimulationControl.hpp" | ||
| 48 | #include "../model/SimulationControl_Impl.hpp" | ||
| 49 | #include "../model/RunPeriod.hpp" | ||
| 50 | #include "../model/RunPeriod_Impl.hpp" | ||
| 51 | #include "../model/YearDescription.hpp" | ||
| 52 | #include "../model/YearDescription_Impl.hpp" | ||
| 53 | #include "../model/OutputControlReportingTolerances.hpp" | ||
| 54 | #include "../model/OutputControlReportingTolerances_Impl.hpp" | ||
| 55 | #include "../model/SubSurface.hpp" | ||
| 56 | #include "../model/SubSurface_Impl.hpp" | ||
| 57 | #include "../model/ChillerElectricEIR.hpp" | ||
| 58 | #include "../model/ChillerElectricEIR_Impl.hpp" | ||
| 59 | #include "../model/CoolingTowerSingleSpeed.hpp" | ||
| 60 | #include "../model/CoolingTowerSingleSpeed_Impl.hpp" | ||
| 61 | #include "../model/BoilerHotWater.hpp" | ||
| 62 | #include "../model/BoilerHotWater_Impl.hpp" | ||
| 63 | #include "../model/SizingParameters.hpp" | ||
| 64 | #include "../model/SizingParameters_Impl.hpp" | ||
| 65 | #include "../model/SiteWaterMainsTemperature.hpp" | ||
| 66 | #include "../model/SiteWaterMainsTemperature_Impl.hpp" | ||
| 67 | #include "../model/Schedule.hpp" | ||
| 68 | #include "../model/Schedule_Impl.hpp" | ||
| 69 | #include "../model/Splitter.hpp" | ||
| 70 | #include "../model/Splitter_Impl.hpp" | ||
| 71 | #include "../model/Mixer.hpp" | ||
| 72 | #include "../model/Mixer_Impl.hpp" | ||
| 73 | #include "../model/OutputMeter.hpp" | ||
| 74 | #include "../model/OutputMeter_Impl.hpp" | ||
| 75 | #include "../model/WaterToWaterComponent.hpp" | ||
| 76 | #include "../model/WaterToWaterComponent_Impl.hpp" | ||
| 77 | #include "../model/WaterToAirComponent.hpp" | ||
| 78 | #include "../model/WaterToAirComponent_Impl.hpp" | ||
| 79 | #include "../model/ZoneHVACComponent.hpp" | ||
| 80 | #include "../model/ZoneHVACComponent_Impl.hpp" | ||
| 81 | #include "../model/PortList.hpp" | ||
| 82 | #include "../model/PortList_Impl.hpp" | ||
| 83 | #include "../model/ZoneHVACPackagedTerminalAirConditioner.hpp" | ||
| 84 | #include "../model/ZoneHVACPackagedTerminalAirConditioner_Impl.hpp" | ||
| 85 | #include "../model/ZoneHVACPackagedTerminalHeatPump.hpp" | ||
| 86 | #include "../model/ZoneHVACPackagedTerminalHeatPump_Impl.hpp" | ||
| 87 | #include "../model/ZoneHVACWaterToAirHeatPump.hpp" | ||
| 88 | #include "../model/ZoneHVACWaterToAirHeatPump_Impl.hpp" | ||
| 89 | #include "../model/ZoneHVACFourPipeFanCoil.hpp" | ||
| 90 | #include "../model/ZoneHVACFourPipeFanCoil_Impl.hpp" | ||
| 91 | #include "../model/ZoneHVACBaseboardConvectiveElectric.hpp" | ||
| 92 | #include "../model/ZoneHVACBaseboardConvectiveElectric_Impl.hpp" | ||
| 93 | #include "../model/ZoneHVACBaseboardConvectiveWater.hpp" | ||
| 94 | #include "../model/ZoneHVACBaseboardConvectiveWater_Impl.hpp" | ||
| 95 | #include "../energyplus/ReverseTranslator.hpp" | ||
| 96 | #include "../osversion/VersionTranslator.hpp" | ||
| 97 | #include "../utilities/filetypes/EpwFile.hpp" | ||
| 98 | #include "../utilities/plot/ProgressBar.hpp" | ||
| 99 | #include "../utilities/core/Assert.hpp" | ||
| 100 | #include "../utilities/core/FilesystemHelpers.hpp" | ||
| 101 | #include "../utilities/core/StringHelpers.hpp" | ||
| 102 | #include "../utilities/units/QuantityConverter.hpp" | ||
| 103 | #include "../utilities/units/Quantity.hpp" | ||
| 104 | #include "../utilities/units/IPUnit.hpp" | ||
| 105 | #include "../utilities/units/SIUnit.hpp" | ||
| 106 | #include "../utilities/units/BTUUnit.hpp" | ||
| 107 | #include "../utilities/units/CFMUnit.hpp" | ||
| 108 | #include "../utilities/units/FahrenheitUnit.hpp" | ||
| 109 | #include "../utilities/units/MPHUnit.hpp" | ||
| 110 | #include "../utilities/units/WhUnit.hpp" | ||
| 111 | #include "../utilities/time/Time.hpp" | ||
| 112 | #include "../utilities/units/UnitFactory.hpp" | ||
| 113 | #include "../utilities/units/Unit.hpp" | ||
| 114 | |||
| 115 | #include <pugixml.hpp> | ||
| 116 | |||
| 117 | namespace openstudio { | ||
| 118 | namespace sdd { | ||
| 119 | |||
| 120 | ✗ | std::ostream& operator<<(std::ostream& os, const pugi::xml_node& element) { | |
| 121 | ✗ | pugi::xml_document doc; | |
| 122 | ✗ | doc.append_copy(element); | |
| 123 | ✗ | doc.save(os, " "); | |
| 124 | ✗ | return os; | |
| 125 | ✗ | } | |
| 126 | |||
| 127 |
1/1✓ Branch 7 taken 1 time.
|
1 | ReverseTranslator::ReverseTranslator(bool masterAutosize) : m_isInputXML(false), m_autosize(true), m_masterAutosize(masterAutosize) { |
| 128 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_logSink.setLogLevel(Warn); |
| 129 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | m_logSink.setChannelRegex(boost::regex("openstudio\\.sdd\\.ReverseTranslator")); |
| 130 |
1/1✓ Branch 2 taken 1 time.
|
1 | m_logSink.setThreadId(std::this_thread::get_id()); |
| 131 | 1 | } | |
| 132 | |||
| 133 | 1 | ReverseTranslator::~ReverseTranslator() = default; | |
| 134 | |||
| 135 | 1 | boost::optional<openstudio::model::Model> ReverseTranslator::loadModel(const openstudio::path& path, ProgressBar* progressBar) { | |
| 136 | |||
| 137 | 1 | m_path = path; | |
| 138 | |||
| 139 | 1 | m_progressBar = progressBar; | |
| 140 | |||
| 141 | 1 | m_logSink.setThreadId(std::this_thread::get_id()); | |
| 142 | |||
| 143 | 1 | m_logSink.resetStringStream(); | |
| 144 | |||
| 145 | 1 | boost::optional<openstudio::model::Model> result; | |
| 146 | |||
| 147 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (openstudio::filesystem::exists(path)) { |
| 148 |
1/1✓ Branch 1 taken 1 time.
|
1 | openstudio::filesystem::ifstream file(path, std::ios_base::binary); |
| 149 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (file.is_open()) { |
| 150 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_document doc; |
| 151 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_parse_result success = doc.load(file); |
| 152 |
1/1✓ Branch 1 taken 1 time.
|
1 | file.close(); |
| 153 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (success) { |
| 154 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | result = this->convert(doc.document_element()); |
| 155 | } else { | ||
| 156 | ✗ | LOG(Error, "Could not open file '" << toString(path) << "'"); | |
| 157 | } | ||
| 158 | 1 | } else { | |
| 159 | ✗ | LOG(Error, "Could not open file '" << toString(path) << "'"); | |
| 160 | } | ||
| 161 | 1 | } else { | |
| 162 | ✗ | LOG(Error, "File '" << toString(path) << "' does not exist"); | |
| 163 | } | ||
| 164 | |||
| 165 | 1 | return result; | |
| 166 | ✗ | } | |
| 167 | |||
| 168 | ✗ | std::vector<LogMessage> ReverseTranslator::warnings() const { | |
| 169 | ✗ | std::vector<LogMessage> result; | |
| 170 | ✗ | std::vector<LogMessage> allMessages = m_logSink.logMessages(); | |
| 171 | ✗ | std::copy_if(allMessages.cbegin(), allMessages.cend(), std::back_inserter(result), | |
| 172 | ✗ | [](const auto& logMessage) { return logMessage.logLevel() == Warn; }); | |
| 173 | ✗ | return result; | |
| 174 | ✗ | } | |
| 175 | |||
| 176 | ✗ | std::vector<LogMessage> ReverseTranslator::errors() const { | |
| 177 | ✗ | std::vector<LogMessage> result; | |
| 178 | ✗ | std::vector<LogMessage> allMessages = m_logSink.logMessages(); | |
| 179 | ✗ | std::copy_if(allMessages.cbegin(), allMessages.cend(), std::back_inserter(result), | |
| 180 | ✗ | [](const auto& logMessage) { return logMessage.logLevel() > Warn; }); | |
| 181 | ✗ | return result; | |
| 182 | ✗ | } | |
| 183 | |||
| 184 | 1086 | std::string ReverseTranslator::escapeName(std::string name) { | |
| 185 | 1086 | std::replace(name.begin(), name.end(), ',', '-'); | |
| 186 | 1086 | std::replace(name.begin(), name.end(), ';', '-'); | |
| 187 | 1086 | return name; | |
| 188 | } | ||
| 189 | |||
| 190 | 1 | boost::optional<model::Model> ReverseTranslator::convert(const pugi::xml_node& root) { | |
| 191 | 1 | return translateSDD(root); | |
| 192 | } | ||
| 193 | |||
| 194 | 1 | boost::optional<model::Model> ReverseTranslator::translateSDD(const pugi::xml_node& root) { | |
| 195 | 1 | boost::optional<model::Model> result; | |
| 196 | |||
| 197 | // get project, assume one project per file | ||
| 198 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node projectElement = root.child("Proj"); |
| 199 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!projectElement) { |
| 200 | ✗ | LOG(Error, "Could not find required element 'Proj'"); | |
| 201 | ✗ | return boost::none; | |
| 202 | } | ||
| 203 | |||
| 204 | // check if this is a simulation xml or input xml | ||
| 205 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simFlagElement = projectElement.child("SimFlag"); |
| 206 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!simFlagElement) { |
| 207 | ✗ | m_isInputXML = true; | |
| 208 | ✗ | LOG(Error, "Import of Input SDD XML type is not currently supported"); | |
| 209 | ✗ | return boost::none; | |
| 210 | } else { | ||
| 211 | 1 | m_isInputXML = false; | |
| 212 | } | ||
| 213 | |||
| 214 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result = openstudio::model::Model(); |
| 215 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result->setFastNaming(true); |
| 216 | |||
| 217 | // do runperiod | ||
| 218 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<model::ModelObject> runPeriod = translateRunPeriod(projectElement, *result); |
| 219 | //if (!runPeriod) { | ||
| 220 | // LOG(Error, "Could not translate RunPeriod"); | ||
| 221 | //} | ||
| 222 | |||
| 223 | // do design days | ||
| 224 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | std::vector<WorkspaceObject> designDays = translateDesignDays(projectElement, *result); |
| 225 | //if (designDays.empty()) { | ||
| 226 | // LOG(Error, "Empty DesignDays"); | ||
| 227 | //} | ||
| 228 | |||
| 229 | // do weather file | ||
| 230 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<model::ModelObject> weatherFile = translateWeatherFile(projectElement, *result); |
| 231 | //if (!weatherFile) { | ||
| 232 | // LOG(Error, "Could not translate WeatherFile"); | ||
| 233 | //} | ||
| 234 | |||
| 235 | // do site after design days and weather file | ||
| 236 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<model::ModelObject> site = translateSite(projectElement, *result); |
| 237 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!site) { |
| 238 | ✗ | LOG(Error, "Could not find site information in SDD"); | |
| 239 | } | ||
| 240 | |||
| 241 | // Shading Model | ||
| 242 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | std::string solDistribution = projectElement.child("SolDistribution").text().as_string(); |
| 243 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if (istringEqual("FullExterior", solDistribution)) { |
| 244 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto simulationControl = result->getUniqueModelObject<model::SimulationControl>(); |
| 245 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | simulationControl.setSolarDistribution("FullExterior"); |
| 246 |
0/4✗ Branch 2 not taken.
✗ Branch 5 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
|
1 | } else if (istringEqual("MinimalShadowing", solDistribution)) { |
| 247 | ✗ | auto simulationControl = result->getUniqueModelObject<model::SimulationControl>(); | |
| 248 | ✗ | simulationControl.setSolarDistribution("MinimalShadowing"); | |
| 249 | ✗ | } | |
| 250 | |||
| 251 | // HVACAutoSizing | ||
| 252 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node hvacAutoSizingElement = projectElement.child("HVACAutoSizing"); |
| 253 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
1 | if (hvacAutoSizingElement.text().as_int() == 0) { |
| 254 | 1 | m_autosize = false; | |
| 255 | } | ||
| 256 | |||
| 257 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto sp = result->getUniqueModelObject<model::SizingParameters>(); |
| 258 |
1/1✓ Branch 1 taken 1 time.
|
1 | sp.setHeatingSizingFactor(1.0); |
| 259 |
1/1✓ Branch 1 taken 1 time.
|
1 | sp.setCoolingSizingFactor(1.0); |
| 260 | |||
| 261 | // do materials before constructions | ||
| 262 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> materialElements = makeVectorOfChildren(projectElement, "Mat"); |
| 263 | |||
| 264 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 265 | ✗ | m_progressBar->setWindowTitle(toString("Translating Materials")); | |
| 266 | ✗ | m_progressBar->setMinimum(0); | |
| 267 | ✗ | m_progressBar->setMaximum(materialElements.size()); | |
| 268 | ✗ | m_progressBar->setValue(0); | |
| 269 | } | ||
| 270 | |||
| 271 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 2 taken 1 time.
|
12 | for (std::vector<pugi::xml_node>::size_type i = 0; i < materialElements.size(); ++i) { |
| 272 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 5 taken 11 times.
|
11 | boost::optional<model::ModelObject> material = translateMaterial(materialElements[i], *result); |
| 273 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 11 times.
|
11 | if (!material) { |
| 274 | ✗ | LOG(Error, "Failed to translate 'Mat' element " << i); | |
| 275 | } | ||
| 276 | |||
| 277 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
|
11 | if (m_progressBar) { |
| 278 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 279 | } | ||
| 280 | 11 | } | |
| 281 | |||
| 282 | // do constructions before geometry | ||
| 283 | |||
| 284 | // layered constructions | ||
| 285 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> constructionElements = makeVectorOfChildren(projectElement, "ConsAssm"); |
| 286 | |||
| 287 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 288 | ✗ | m_progressBar->setWindowTitle(toString("Translating Constructions")); | |
| 289 | ✗ | m_progressBar->setMinimum(0); | |
| 290 | ✗ | m_progressBar->setMaximum(constructionElements.size()); | |
| 291 | ✗ | m_progressBar->setValue(0); | |
| 292 | } | ||
| 293 | |||
| 294 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 time.
|
8 | for (std::vector<pugi::xml_node>::size_type i = 0; i < constructionElements.size(); ++i) { |
| 295 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 5 taken 7 times.
|
7 | boost::optional<model::ModelObject> construction = translateConstructAssembly(constructionElements[i], *result); |
| 296 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
|
7 | if (!construction) { |
| 297 | ✗ | LOG(Error, "Failed to translate 'ConsAssm' element " << i); | |
| 298 | } | ||
| 299 | |||
| 300 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
|
7 | if (m_progressBar) { |
| 301 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 302 | } | ||
| 303 | 7 | } | |
| 304 | |||
| 305 | // door constructions | ||
| 306 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> doorConstructionElements = makeVectorOfChildren(projectElement, "DrCons"); |
| 307 | |||
| 308 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 309 | ✗ | m_progressBar->setWindowTitle(toString("Translating Door Constructions")); | |
| 310 | ✗ | m_progressBar->setMinimum(0); | |
| 311 | ✗ | m_progressBar->setMaximum(doorConstructionElements.size()); | |
| 312 | ✗ | m_progressBar->setValue(0); | |
| 313 | } | ||
| 314 | |||
| 315 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | for (std::vector<pugi::xml_node>::size_type i = 0; i < doorConstructionElements.size(); ++i) { |
| 316 | ✗ | boost::optional<model::ModelObject> doorConstruction = translateDoorConstruction(doorConstructionElements[i], *result); | |
| 317 | ✗ | if (!doorConstruction) { | |
| 318 | ✗ | LOG(Error, "Failed to translate 'DrCons' element " << i); | |
| 319 | } | ||
| 320 | |||
| 321 | ✗ | if (m_progressBar) { | |
| 322 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 323 | } | ||
| 324 | ✗ | } | |
| 325 | |||
| 326 | // fenestration constructions | ||
| 327 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> fenestrationConstructionElements = makeVectorOfChildren(projectElement, "FenCons"); |
| 328 | |||
| 329 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 330 | ✗ | m_progressBar->setWindowTitle(toString("Translating Fenestration Constructions")); | |
| 331 | ✗ | m_progressBar->setMinimum(0); | |
| 332 | ✗ | m_progressBar->setMaximum(fenestrationConstructionElements.size()); | |
| 333 | ✗ | m_progressBar->setValue(0); | |
| 334 | } | ||
| 335 | |||
| 336 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
|
2 | for (std::vector<pugi::xml_node>::size_type i = 0; i < fenestrationConstructionElements.size(); ++i) { |
| 337 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
|
1 | boost::optional<model::ModelObject> fenestrationConstruction = translateFenestrationConstruction(fenestrationConstructionElements[i], *result); |
| 338 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!fenestrationConstruction) { |
| 339 | ✗ | LOG(Error, "Failed to translate 'FenCons' element " << i); | |
| 340 | } | ||
| 341 | |||
| 342 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 343 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 344 | } | ||
| 345 | 1 | } | |
| 346 | |||
| 347 | 1 | int i = 0; | |
| 348 |
6/6✓ Branch 1 taken 1 time.
✓ Branch 6 taken 5 times.
✓ Branch 9 taken 5 times.
✓ Branch 12 taken 6 times.
✓ Branch 14 taken 5 times.
✓ Branch 15 taken 1 time.
|
6 | for (const pugi::xml_node& crvDblQuadElement : projectElement.children("CrvDblQuad")) { |
| 349 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | boost::optional<model::ModelObject> curve = translateCrvDblQuad(crvDblQuadElement, *result); |
| 350 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
|
5 | if (!curve) { |
| 351 | ✗ | LOG(Error, "Failed to translate 'CrvDblQuad' element " << i); | |
| 352 | } | ||
| 353 | 5 | } | |
| 354 | |||
| 355 | 1 | i = 0; | |
| 356 |
6/6✓ Branch 1 taken 1 time.
✓ Branch 6 taken 3 times.
✓ Branch 9 taken 3 times.
✓ Branch 12 taken 4 times.
✓ Branch 14 taken 3 times.
✓ Branch 15 taken 1 time.
|
4 | for (const pugi::xml_node& crvCubicElement : projectElement.children("CrvCubic")) { |
| 357 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | boost::optional<model::ModelObject> curve = translateCrvCubic(crvCubicElement, *result); |
| 358 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!curve) { |
| 359 | ✗ | LOG(Error, "Failed to translate 'CrvCubic' element " << i); | |
| 360 | } | ||
| 361 | 3 | } | |
| 362 | |||
| 363 | 1 | i = 0; | |
| 364 |
6/6✓ Branch 1 taken 1 time.
✓ Branch 6 taken 3 times.
✓ Branch 9 taken 3 times.
✓ Branch 12 taken 4 times.
✓ Branch 14 taken 3 times.
✓ Branch 15 taken 1 time.
|
4 | for (const pugi::xml_node& crvQuadElement : projectElement.children("CrvQuad")) { |
| 365 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | boost::optional<model::ModelObject> curve = translateCrvQuad(crvQuadElement, *result); |
| 366 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!curve) { |
| 367 | ✗ | LOG(Error, "Failed to translate 'CrvQuad' element " << i << " named '" << crvQuadElement.child("Name").text().as_string() << "'."); | |
| 368 | } | ||
| 369 | 3 | } | |
| 370 | |||
| 371 | 1 | i = 0; | |
| 372 |
3/6✓ Branch 1 taken 1 time.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | for (const pugi::xml_node& crvLinElement : projectElement.children("CrvLin")) { |
| 373 | ✗ | boost::optional<model::ModelObject> curve = translateCrvLin(crvLinElement, *result); | |
| 374 | ✗ | if (!curve) { | |
| 375 | ✗ | LOG(Error, "Failed to translate 'CrvLin' element " << i); | |
| 376 | } | ||
| 377 | ✗ | } | |
| 378 | |||
| 379 | 1 | i = 0; | |
| 380 |
3/6✓ Branch 1 taken 1 time.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | for (const pugi::xml_node& crvMapSglVarElement : projectElement.children("CrvMapSglVar")) { |
| 381 | ✗ | boost::optional<model::ModelObject> curve = translateCrvMapSglVar(crvMapSglVarElement, *result); | |
| 382 | ✗ | if (!curve) { | |
| 383 | ✗ | LOG(Error, "Failed to translate 'CrvMapSglVar' element " << i); | |
| 384 | } | ||
| 385 | ✗ | } | |
| 386 | |||
| 387 | 1 | i = 0; | |
| 388 |
3/6✓ Branch 1 taken 1 time.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | for (const pugi::xml_node& crvMapDblVarElement : projectElement.children("CrvMapDblVar")) { |
| 389 | ✗ | boost::optional<model::ModelObject> curve = translateCrvMapDblVar(crvMapDblVarElement, *result); | |
| 390 | ✗ | if (!curve) { | |
| 391 | ✗ | LOG(Error, "Failed to translate 'CrvMapDblVar' element " << i); | |
| 392 | } | ||
| 393 | ✗ | } | |
| 394 | |||
| 395 | // do schedules before loads | ||
| 396 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> scheduleDayElements = makeVectorOfChildren(projectElement, "SchDay"); |
| 397 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 398 | ✗ | m_progressBar->setWindowTitle(toString("Translating Day Schedules")); | |
| 399 | ✗ | m_progressBar->setMinimum(0); | |
| 400 | ✗ | m_progressBar->setMaximum(scheduleDayElements.size()); | |
| 401 | ✗ | m_progressBar->setValue(0); | |
| 402 | } | ||
| 403 | |||
| 404 |
2/2✓ Branch 1 taken 48 times.
✓ Branch 2 taken 1 time.
|
49 | for (std::vector<pugi::xml_node>::size_type i = 0; i < scheduleDayElements.size(); ++i) { |
| 405 |
2/2✓ Branch 1 taken 48 times.
✓ Branch 5 taken 48 times.
|
48 | boost::optional<model::ModelObject> scheduleDay = translateScheduleDay(scheduleDayElements[i], *result); |
| 406 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 48 times.
|
48 | if (!scheduleDay) { |
| 407 | ✗ | LOG(Error, "Failed to translate 'SchDay' element " << i); | |
| 408 | } | ||
| 409 | |||
| 410 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
|
48 | if (m_progressBar) { |
| 411 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 412 | } | ||
| 413 | 48 | } | |
| 414 | |||
| 415 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> scheduleWeekElements = makeVectorOfChildren(projectElement, "SchWeek"); |
| 416 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 417 | ✗ | m_progressBar->setWindowTitle(toString("Translating Week Schedules")); | |
| 418 | ✗ | m_progressBar->setMinimum(0); | |
| 419 | ✗ | m_progressBar->setMaximum(scheduleWeekElements.size()); | |
| 420 | ✗ | m_progressBar->setValue(0); | |
| 421 | } | ||
| 422 | |||
| 423 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 2 taken 1 time.
|
29 | for (std::vector<pugi::xml_node>::size_type i = 0; i < scheduleWeekElements.size(); ++i) { |
| 424 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 5 taken 28 times.
|
28 | boost::optional<model::ModelObject> scheduleWeek = translateScheduleWeek(scheduleWeekElements[i], *result); |
| 425 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
|
28 | if (!scheduleWeek) { |
| 426 | ✗ | LOG(Error, "Failed to translate 'SchWeek' element " << i); | |
| 427 | } | ||
| 428 | |||
| 429 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | if (m_progressBar) { |
| 430 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 431 | } | ||
| 432 | 28 | } | |
| 433 | |||
| 434 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> scheduleElements = makeVectorOfChildren(projectElement, "Sch"); |
| 435 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 436 | ✗ | m_progressBar->setWindowTitle(toString("Translating Year Schedules")); | |
| 437 | ✗ | m_progressBar->setMinimum(0); | |
| 438 | ✗ | m_progressBar->setMaximum(scheduleElements.size()); | |
| 439 | ✗ | m_progressBar->setValue(0); | |
| 440 | } | ||
| 441 | |||
| 442 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 2 taken 1 time.
|
15 | for (std::vector<pugi::xml_node>::size_type i = 0; i < scheduleElements.size(); ++i) { |
| 443 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 5 taken 14 times.
|
14 | boost::optional<model::ModelObject> schedule = translateSchedule(scheduleElements[i], *result); |
| 444 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 14 times.
|
14 | if (!schedule) { |
| 445 | ✗ | LOG(Error, "Failed to translate 'Sch' element " << i); | |
| 446 | } | ||
| 447 | |||
| 448 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | if (m_progressBar) { |
| 449 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 450 | } | ||
| 451 | 14 | } | |
| 452 | |||
| 453 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> holidayElements = makeVectorOfChildren(projectElement, "Hol"); |
| 454 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 455 | ✗ | m_progressBar->setWindowTitle(toString("Translating Holidays")); | |
| 456 | ✗ | m_progressBar->setMinimum(0); | |
| 457 | ✗ | m_progressBar->setMaximum(holidayElements.size()); | |
| 458 | ✗ | m_progressBar->setValue(0); | |
| 459 | } | ||
| 460 | |||
| 461 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 2 taken 1 time.
|
11 | for (std::vector<pugi::xml_node>::size_type i = 0; i < holidayElements.size(); ++i) { |
| 462 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 5 taken 10 times.
|
10 | boost::optional<model::ModelObject> holiday = translateHoliday(holidayElements[i], *result); |
| 463 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 10 times.
|
10 | if (!holiday) { |
| 464 | ✗ | LOG(Error, "Failed to translate 'Hol' element " << i); | |
| 465 | } | ||
| 466 | |||
| 467 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
|
10 | if (m_progressBar) { |
| 468 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 469 | } | ||
| 470 | 10 | } | |
| 471 | |||
| 472 | // do water mains temperatures, do after schedules | ||
| 473 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<model::ModelObject> waterMainsTemperature = translateWaterMainsTemperature(projectElement, *result); |
| 474 | //if (!waterMainsTemperature){ | ||
| 475 | // LOG(Error, "Could not translate WaterMainsTemperature"); | ||
| 476 | //} | ||
| 477 | |||
| 478 | // translate shadingSurfaces | ||
| 479 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> exteriorShadingElements = makeVectorOfChildren(projectElement, "ExtShdgObj"); |
| 480 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!exteriorShadingElements.empty()) { |
| 481 | ✗ | model::ShadingSurfaceGroup shadingSurfaceGroup(*result); | |
| 482 | ✗ | shadingSurfaceGroup.setName("Site ShadingGroup"); | |
| 483 | ✗ | shadingSurfaceGroup.setShadingSurfaceType("Site"); | |
| 484 | ✗ | for (std::vector<pugi::xml_node>::size_type i = 0; i < exteriorShadingElements.size(); ++i) { | |
| 485 | ✗ | if (exteriorShadingElements[i].parent() == projectElement) { | |
| 486 | ✗ | boost::optional<model::ModelObject> exteriorShading = translateShadingSurface(exteriorShadingElements[i], shadingSurfaceGroup); | |
| 487 | ✗ | if (!exteriorShading) { | |
| 488 | ✗ | LOG(Error, "Failed to translate 'ExtShdgObj' element " << i); | |
| 489 | } | ||
| 490 | ✗ | } | |
| 491 | } | ||
| 492 | ✗ | } | |
| 493 | |||
| 494 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto facility = result->getUniqueModelObject<openstudio::model::Facility>(); |
| 495 | |||
| 496 | // translate the building | ||
| 497 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node buildingElement = projectElement.child("Bldg"); |
| 498 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!buildingElement) { |
| 499 | ✗ | LOG(Error, "Required 'Bldg' element is Null"); | |
| 500 | } else { | ||
| 501 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<model::ModelObject> building = translateBuilding(buildingElement, *result); |
| 502 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!building) { |
| 503 | ✗ | LOG(Error, "Failed to translate 'Bldg'"); | |
| 504 | } | ||
| 505 | 1 | } | |
| 506 | |||
| 507 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result->setFastNaming(false); |
| 508 | |||
| 509 | // FluidSys | ||
| 510 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> fluidSysElements = makeVectorOfChildren(projectElement, "FluidSys"); |
| 511 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 512 | ✗ | m_progressBar->setWindowTitle(toString("Translating Fluid Systems")); | |
| 513 | ✗ | m_progressBar->setMinimum(0); | |
| 514 | ✗ | m_progressBar->setMaximum(fluidSysElements.size()); | |
| 515 | ✗ | m_progressBar->setValue(0); | |
| 516 | } | ||
| 517 | |||
| 518 | // Translate condenser systems | ||
| 519 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 time.
|
6 | for (std::vector<pugi::xml_node>::size_type i = 0; i < fluidSysElements.size(); ++i) { |
| 520 |
3/4✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 5 times.
|
5 | if (!fluidSysElements[i].child("Name")) { |
| 521 | 4 | continue; | |
| 522 | } | ||
| 523 |
8/8✓ Branch 1 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
✓ Branch 11 taken 5 times.
✓ Branch 14 taken 5 times.
✓ Branch 17 taken 5 times.
✓ Branch 21 taken 4 times.
✓ Branch 22 taken 1 time.
|
15 | if (!openstudio::istringEqual(fluidSysElements[i].child("Type").text().as_string(), "condenserwater")) { |
| 524 | 4 | continue; | |
| 525 | } | ||
| 526 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
|
1 | boost::optional<model::ModelObject> plantLoop = translateFluidSys(fluidSysElements[i], *result); |
| 527 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
|
1 | OS_ASSERT(plantLoop); |
| 528 | |||
| 529 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 530 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 531 | } | ||
| 532 | 1 | } | |
| 533 | |||
| 534 | // Translate hot water systems | ||
| 535 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 time.
|
6 | for (std::vector<pugi::xml_node>::size_type i = 0; i < fluidSysElements.size(); ++i) { |
| 536 |
3/4✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 5 times.
|
5 | if (!fluidSysElements[i].child("Name")) { |
| 537 | 3 | continue; | |
| 538 | } | ||
| 539 |
8/8✓ Branch 1 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
✓ Branch 11 taken 5 times.
✓ Branch 14 taken 5 times.
✓ Branch 17 taken 5 times.
✓ Branch 21 taken 3 times.
✓ Branch 22 taken 2 times.
|
15 | if (!openstudio::istringEqual(fluidSysElements[i].child("Type").text().as_string(), "hotwater")) { |
| 540 | 3 | continue; | |
| 541 | } | ||
| 542 | |||
| 543 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
|
2 | boost::optional<model::ModelObject> plantLoop = translateFluidSys(fluidSysElements[i], *result); |
| 544 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(plantLoop); |
| 545 | |||
| 546 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (m_progressBar) { |
| 547 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 548 | } | ||
| 549 | 2 | } | |
| 550 | |||
| 551 | // Translate chilled water systems | ||
| 552 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 time.
|
6 | for (std::vector<pugi::xml_node>::size_type i = 0; i < fluidSysElements.size(); ++i) { |
| 553 |
3/4✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 5 times.
|
5 | if (!fluidSysElements[i].child("Name")) { |
| 554 | 4 | continue; | |
| 555 | } | ||
| 556 |
8/8✓ Branch 1 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
✓ Branch 11 taken 5 times.
✓ Branch 14 taken 5 times.
✓ Branch 17 taken 5 times.
✓ Branch 21 taken 4 times.
✓ Branch 22 taken 1 time.
|
15 | if (!openstudio::istringEqual(fluidSysElements[i].child("Type").text().as_string(), "chilledwater")) { |
| 557 | 4 | continue; | |
| 558 | } | ||
| 559 | |||
| 560 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
|
1 | boost::optional<model::ModelObject> plantLoop = translateFluidSys(fluidSysElements[i], *result); |
| 561 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
|
1 | OS_ASSERT(plantLoop); |
| 562 | |||
| 563 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 564 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 565 | } | ||
| 566 | 1 | } | |
| 567 | |||
| 568 | // We're left with 'servicehotwater' type | ||
| 569 | |||
| 570 | // AirSystem | ||
| 571 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> airSystemElements = makeVectorOfChildren(buildingElement, "AirSys"); |
| 572 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 573 | ✗ | m_progressBar->setWindowTitle(toString("Translating Air Systems")); | |
| 574 | ✗ | m_progressBar->setMinimum(0); | |
| 575 | ✗ | m_progressBar->setMaximum(airSystemElements.size()); | |
| 576 | ✗ | m_progressBar->setValue(0); | |
| 577 | } | ||
| 578 | |||
| 579 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 time.
|
6 | for (std::vector<pugi::xml_node>::size_type i = 0; i < airSystemElements.size(); ++i) { |
| 580 |
3/4✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 5 times.
|
5 | if (!airSystemElements[i].child("Name")) { |
| 581 | ✗ | continue; | |
| 582 | } | ||
| 583 | // TODO: No check on whether that worked or not? | ||
| 584 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 5 taken 5 times.
|
5 | translateAirSystem(airSystemElements[i], *result); |
| 585 | |||
| 586 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (m_progressBar) { |
| 587 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 588 | } | ||
| 589 | } | ||
| 590 | |||
| 591 | // VRFSys | ||
| 592 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> vrfSystemElements = makeVectorOfChildren(buildingElement, "VRFSys"); |
| 593 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 594 | ✗ | m_progressBar->setWindowTitle(toString("Translating VRF Systems")); | |
| 595 | ✗ | m_progressBar->setMinimum(0); | |
| 596 | ✗ | m_progressBar->setMaximum(vrfSystemElements.size()); | |
| 597 | ✗ | m_progressBar->setValue(0); | |
| 598 | } | ||
| 599 | |||
| 600 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | for (std::vector<pugi::xml_node>::size_type i = 0; i < vrfSystemElements.size(); ++i) { |
| 601 | ✗ | if (!vrfSystemElements[i].child("Name")) { | |
| 602 | ✗ | continue; | |
| 603 | } | ||
| 604 | // TODO: No check on whether that worked or not? | ||
| 605 | ✗ | translateVRFSys(vrfSystemElements[i], *result); | |
| 606 | |||
| 607 | ✗ | if (m_progressBar) { | |
| 608 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 609 | } | ||
| 610 | } | ||
| 611 | |||
| 612 | // ThermalZone | ||
| 613 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::vector<pugi::xml_node> thermalZoneElements = makeVectorOfChildren(buildingElement, "ThrmlZn"); |
| 614 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (m_progressBar) { |
| 615 | ✗ | m_progressBar->setWindowTitle(toString("Translating Thermal Zones")); | |
| 616 | ✗ | m_progressBar->setMinimum(0); | |
| 617 | ✗ | m_progressBar->setMaximum(airSystemElements.size()); | |
| 618 | ✗ | m_progressBar->setValue(0); | |
| 619 | } | ||
| 620 | |||
| 621 |
2/2✓ Branch 1 taken 25 times.
✓ Branch 2 taken 1 time.
|
26 | for (std::vector<pugi::xml_node>::size_type i = 0; i < thermalZoneElements.size(); ++i) { |
| 622 |
3/4✓ Branch 2 taken 25 times.
✓ Branch 5 taken 25 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 25 times.
|
25 | if (!thermalZoneElements[i].child("Name")) { |
| 623 | ✗ | continue; | |
| 624 | } | ||
| 625 | |||
| 626 |
2/2✓ Branch 1 taken 25 times.
✓ Branch 5 taken 25 times.
|
25 | boost::optional<model::ModelObject> thermalZone = translateThermalZone(thermalZoneElements[i], *result); |
| 627 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
|
25 | if (!thermalZone) { |
| 628 | ✗ | LOG(Error, "Failed to translate 'ThrmlZn' element " << i); | |
| 629 | } | ||
| 630 | |||
| 631 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 25 times.
|
25 | if (m_progressBar) { |
| 632 | ✗ | m_progressBar->setValue(m_progressBar->value() + 1); | |
| 633 | } | ||
| 634 | 25 | } | |
| 635 | |||
| 636 | // Give the nodes better names | ||
| 637 | // We do this here because the loops need to be completely assembled | ||
| 638 | // with their supply AND demand sides. ie. After zones are attached. | ||
| 639 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | std::vector<model::PlantLoop> plantLoops = result->getConcreteModelObjects<model::PlantLoop>(); |
| 640 | |||
| 641 |
2/2✓ Branch 4 taken 5 times.
✓ Branch 5 taken 1 time.
|
6 | for (auto plantLoop = plantLoops.begin(); plantLoop != plantLoops.end(); ++plantLoop) { |
| 642 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | std::string plantName = plantLoop->name().get(); |
| 643 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | plantLoop->supplyInletNode().setName(plantName + " Supply Inlet Node"); |
| 644 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | plantLoop->demandInletNode().setName(plantName + " Demand Inlet Node"); |
| 645 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | plantLoop->demandSplitter().setName(plantName + " Demand Splitter"); |
| 646 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | plantLoop->demandMixer().setName(plantName + " Demand Mixer"); |
| 647 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | plantLoop->supplySplitter().setName(plantName + " Supply Splitter"); |
| 648 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | plantLoop->supplyMixer().setName(plantName + " Supply Mixer"); |
| 649 | |||
| 650 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
10 | std::vector<model::ModelObject> comps = plantLoop->components(); |
| 651 |
2/2✓ Branch 4 taken 261 times.
✓ Branch 5 taken 5 times.
|
266 | for (auto it = comps.begin(); it != comps.end(); ++it) { |
| 652 |
3/3✓ Branch 2 taken 261 times.
✓ Branch 6 taken 96 times.
✓ Branch 7 taken 165 times.
|
261 | if (!it->optionalCast<model::Node>()) { |
| 653 |
3/3✓ Branch 2 taken 96 times.
✓ Branch 4 taken 36 times.
✓ Branch 5 taken 60 times.
|
192 | if (boost::optional<model::StraightComponent> comp = it->optionalCast<model::StraightComponent>()) { |
| 654 |
3/4✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
✓ Branch 6 taken 36 times.
✗ Branch 7 not taken.
|
72 | if (boost::optional<model::ModelObject> mo = comp->outletModelObject()) { |
| 655 |
6/6✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
✓ Branch 7 taken 36 times.
✓ Branch 10 taken 36 times.
✓ Branch 13 taken 36 times.
✓ Branch 16 taken 36 times.
|
36 | mo->setName(comp->name().get() + " Outlet Node"); |
| 656 | 36 | } | |
| 657 |
3/3✓ Branch 2 taken 60 times.
✓ Branch 4 taken 31 times.
✓ Branch 5 taken 29 times.
|
120 | } else if (boost::optional<model::WaterToAirComponent> comp = it->optionalCast<model::WaterToAirComponent>()) { |
| 658 |
3/4✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
✓ Branch 6 taken 31 times.
✗ Branch 7 not taken.
|
62 | if (boost::optional<model::ModelObject> mo = comp->waterOutletModelObject()) { |
| 659 |
6/6✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
✓ Branch 7 taken 31 times.
✓ Branch 10 taken 31 times.
✓ Branch 13 taken 31 times.
✓ Branch 16 taken 31 times.
|
31 | mo->setName(comp->name().get() + " Water Outlet Node"); |
| 660 | 31 | } | |
| 661 |
3/3✓ Branch 2 taken 29 times.
✓ Branch 4 taken 9 times.
✓ Branch 5 taken 20 times.
|
58 | } else if (boost::optional<model::WaterToWaterComponent> comp = it->optionalCast<model::WaterToWaterComponent>()) { |
| 662 |
3/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 9 times.
✗ Branch 7 not taken.
|
18 | if (boost::optional<model::ModelObject> mo = comp->supplyOutletModelObject()) { |
| 663 |
6/6✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
✓ Branch 13 taken 9 times.
✓ Branch 16 taken 9 times.
|
9 | mo->setName(comp->name().get() + " Supply Outlet Node"); |
| 664 | 9 | } | |
| 665 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 8 times.
✓ Branch 7 taken 1 time.
|
18 | if (boost::optional<model::ModelObject> mo = comp->demandOutletModelObject()) { |
| 666 |
6/6✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
✓ Branch 13 taken 8 times.
✓ Branch 16 taken 8 times.
|
8 | mo->setName(comp->name().get() + " Demand Outlet Node"); |
| 667 | 9 | } | |
| 668 |
3/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 9 times.
|
18 | if (boost::optional<model::ModelObject> mo = comp->tertiaryOutletModelObject()) { |
| 669 | ✗ | mo->setName(comp->name().get() + " Tertiary Demand Outlet Node"); | |
| 670 | 9 | } | |
| 671 |
3/3✓ Branch 2 taken 20 times.
✓ Branch 4 taken 10 times.
✓ Branch 5 taken 10 times.
|
40 | } else if (boost::optional<model::Splitter> comp = it->optionalCast<model::Splitter>()) { |
| 672 | 10 | int branchI = 1; | |
| 673 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | std::vector<model::ModelObject> splitterOutletObjects = comp->outletModelObjects(); |
| 674 |
2/2✓ Branch 4 taken 69 times.
✓ Branch 5 taken 10 times.
|
79 | for (auto it = splitterOutletObjects.begin(); it != splitterOutletObjects.end(); ++it) { |
| 675 |
2/3✓ Branch 2 taken 69 times.
✓ Branch 5 taken 69 times.
✗ Branch 6 not taken.
|
138 | if (it->optionalCast<model::Node>()) { |
| 676 |
6/6✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 7 taken 69 times.
✓ Branch 10 taken 69 times.
✓ Branch 13 taken 69 times.
✓ Branch 16 taken 69 times.
|
69 | std::string branchOutuletName = comp->name().get() + " Outlet Node " + boost::lexical_cast<std::string>(branchI); |
| 677 |
1/1✓ Branch 2 taken 69 times.
|
69 | it->setName(branchOutuletName); |
| 678 | 69 | ++branchI; | |
| 679 | 69 | } | |
| 680 | } | ||
| 681 |
2/3✓ Branch 3 taken 10 times.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
30 | } else if (boost::optional<model::Mixer> comp = it->optionalCast<model::Mixer>()) { |
| 682 |
3/4✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 6 taken 10 times.
✗ Branch 7 not taken.
|
20 | if (boost::optional<model::ModelObject> mixerOutlet = comp->outletModelObject()) { |
| 683 |
6/6✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 10 taken 10 times.
✓ Branch 13 taken 10 times.
✓ Branch 16 taken 10 times.
|
10 | mixerOutlet->setName(comp->name().get() + " Outlet Node"); |
| 684 | 10 | } | |
| 685 | 215 | } | |
| 686 | } | ||
| 687 | } | ||
| 688 | 5 | } | |
| 689 | |||
| 690 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | std::vector<model::AirLoopHVAC> airSystems = result->getConcreteModelObjects<model::AirLoopHVAC>(); |
| 691 | |||
| 692 |
2/2✓ Branch 4 taken 5 times.
✓ Branch 5 taken 1 time.
|
6 | for (auto airSystem = airSystems.begin(); airSystem != airSystems.end(); ++airSystem) { |
| 693 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | std::string systemName = airSystem->name().get(); |
| 694 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | airSystem->supplyInletNode().setName(systemName + " Supply Side (Return Air) Inlet Node"); |
| 695 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | airSystem->demandInletNode().setName(systemName + " Demand Side (Supply Air) Inlet Node"); |
| 696 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | airSystem->demandSplitter().setName(systemName + " Zone Splitter"); |
| 697 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
5 | airSystem->demandMixer().setName(systemName + " Zone Mixer"); |
| 698 | |||
| 699 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
✓ Branch 8 taken 5 times.
|
10 | std::vector<model::ModelObject> comps = airSystem->components(); |
| 700 |
2/2✓ Branch 4 taken 180 times.
✓ Branch 5 taken 5 times.
|
185 | for (auto it = comps.begin(); it != comps.end(); ++it) { |
| 701 |
3/3✓ Branch 2 taken 180 times.
✓ Branch 6 taken 72 times.
✓ Branch 7 taken 108 times.
|
180 | if (!it->optionalCast<model::Node>()) { |
| 702 |
3/3✓ Branch 2 taken 72 times.
✓ Branch 4 taken 26 times.
✓ Branch 5 taken 46 times.
|
144 | if (boost::optional<model::StraightComponent> comp = it->optionalCast<model::StraightComponent>()) { |
| 703 |
3/4✓ Branch 1 taken 26 times.
✓ Branch 4 taken 26 times.
✓ Branch 6 taken 26 times.
✗ Branch 7 not taken.
|
52 | if (boost::optional<model::ModelObject> mo = comp->outletModelObject()) { |
| 704 |
6/6✓ Branch 1 taken 26 times.
✓ Branch 4 taken 26 times.
✓ Branch 7 taken 26 times.
✓ Branch 10 taken 26 times.
✓ Branch 13 taken 26 times.
✓ Branch 16 taken 26 times.
|
26 | mo->setName(comp->name().get() + " Outlet Node"); |
| 705 | 26 | } | |
| 706 |
3/3✓ Branch 2 taken 46 times.
✓ Branch 4 taken 10 times.
✓ Branch 5 taken 36 times.
|
92 | } else if (boost::optional<model::WaterToAirComponent> comp = it->optionalCast<model::WaterToAirComponent>()) { |
| 707 |
3/4✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 6 taken 10 times.
✗ Branch 7 not taken.
|
20 | if (boost::optional<model::ModelObject> mo = comp->airOutletModelObject()) { |
| 708 |
6/6✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 10 taken 10 times.
✓ Branch 13 taken 10 times.
✓ Branch 16 taken 10 times.
|
10 | mo->setName(comp->name().get() + " Air Outlet Node"); |
| 709 | 10 | } | |
| 710 |
3/3✓ Branch 2 taken 36 times.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 31 times.
|
72 | } else if (boost::optional<model::Splitter> comp = it->optionalCast<model::Splitter>()) { |
| 711 | 5 | int branchI = 1; | |
| 712 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | std::vector<model::ModelObject> splitterOutletObjects = comp->outletModelObjects(); |
| 713 |
2/2✓ Branch 4 taken 21 times.
✓ Branch 5 taken 5 times.
|
26 | for (auto it = splitterOutletObjects.begin(); it != splitterOutletObjects.end(); ++it) { |
| 714 |
2/3✓ Branch 2 taken 21 times.
✓ Branch 5 taken 21 times.
✗ Branch 6 not taken.
|
42 | if (it->optionalCast<model::Node>()) { |
| 715 |
6/6✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 13 taken 21 times.
✓ Branch 16 taken 21 times.
|
21 | std::string branchOutuletName = comp->name().get() + " Outlet Node " + boost::lexical_cast<std::string>(branchI); |
| 716 |
1/1✓ Branch 2 taken 21 times.
|
21 | it->setName(branchOutuletName); |
| 717 | 21 | ++branchI; | |
| 718 | 21 | } | |
| 719 | } | ||
| 720 |
3/3✓ Branch 3 taken 31 times.
✓ Branch 5 taken 21 times.
✓ Branch 6 taken 10 times.
|
67 | } else if (boost::optional<model::ThermalZone> comp = it->optionalCast<model::ThermalZone>()) { |
| 721 |
3/4✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 6 taken 21 times.
✗ Branch 7 not taken.
|
42 | if (boost::optional<model::ModelObject> returnAir = comp->returnAirModelObject()) { |
| 722 |
6/6✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 13 taken 21 times.
✓ Branch 16 taken 21 times.
|
21 | returnAir->setName(comp->name().get() + " Return Air Node"); |
| 723 | 21 | } | |
| 724 |
3/3✓ Branch 2 taken 10 times.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 5 times.
|
20 | } else if (boost::optional<model::AirLoopHVACOutdoorAirSystem> comp = it->optionalCast<model::AirLoopHVACOutdoorAirSystem>()) { |
| 725 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 6 taken 5 times.
✗ Branch 7 not taken.
|
10 | if (boost::optional<model::ModelObject> mixedAir = comp->mixedAirModelObject()) { |
| 726 |
6/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
✓ Branch 16 taken 5 times.
|
5 | mixedAir->setName(comp->name().get() + " Mixed Air Node"); |
| 727 | 5 | } | |
| 728 | |||
| 729 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | auto oaNode = comp->outboardOANode(); |
| 730 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | auto reliefNode = comp->outboardReliefNode(); |
| 731 |
1/2✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
|
5 | if (oaNode) { |
| 732 |
6/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
✓ Branch 16 taken 5 times.
|
5 | oaNode->setName(comp->name().get() + " OA Node"); |
| 733 | } | ||
| 734 |
1/2✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
|
5 | if (reliefNode) { |
| 735 |
6/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
✓ Branch 16 taken 5 times.
|
5 | reliefNode->setName(comp->name().get() + " Relief Node"); |
| 736 | } | ||
| 737 | |||
| 738 | { | ||
| 739 |
5/5✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
|
10 | auto oaNodes = subsetCastVector<model::Node>(comp->oaComponents()); |
| 740 |
2/2✓ Branch 5 taken 5 times.
✓ Branch 6 taken 5 times.
|
10 | for (auto& node : oaNodes) { |
| 741 |
5/8✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 5 times.
✓ Branch 6 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
|
5 | if (oaNode && (node != oaNode.get())) { |
| 742 | ✗ | if (const auto& outletComp = node.inletModelObject()) { | |
| 743 | ✗ | node.setName(outletComp->nameString() + " OA Stream Outlet Node"); | |
| 744 | ✗ | } | |
| 745 | } | ||
| 746 | } | ||
| 747 | 5 | } | |
| 748 | |||
| 749 | { | ||
| 750 |
5/5✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
|
10 | auto reliefNodes = subsetCastVector<model::Node>(comp->reliefComponents()); |
| 751 |
2/2✓ Branch 5 taken 5 times.
✓ Branch 6 taken 5 times.
|
10 | for (auto& node : reliefNodes) { |
| 752 |
5/8✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 5 times.
✓ Branch 6 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
|
5 | if (reliefNode && (node != reliefNode.get())) { |
| 753 | ✗ | if (const auto& outletComp = node.inletModelObject()) { | |
| 754 | ✗ | node.setName(outletComp->nameString() + " Relief Stream Outlet Node"); | |
| 755 | ✗ | } | |
| 756 | } | ||
| 757 | } | ||
| 758 | 5 | } | |
| 759 |
2/3✓ Branch 4 taken 5 times.
✓ Branch 6 taken 5 times.
✗ Branch 7 not taken.
|
15 | } else if (boost::optional<model::Mixer> comp = it->optionalCast<model::Mixer>()) { |
| 760 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 6 taken 5 times.
✗ Branch 7 not taken.
|
10 | if (boost::optional<model::ModelObject> mixerOutlet = comp->outletModelObject()) { |
| 761 |
6/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
✓ Branch 16 taken 5 times.
|
5 | mixerOutlet->setName(comp->name().get() + " Outlet Node"); |
| 762 | 5 | } | |
| 763 | 200 | } | |
| 764 | } | ||
| 765 | } | ||
| 766 | 5 | } | |
| 767 | |||
| 768 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | std::vector<model::ZoneHVACComponent> zoneEquipment = result->getModelObjects<model::ZoneHVACComponent>(); |
| 769 |
1/2✗ Branch 4 not taken.
✓ Branch 5 taken 1 time.
|
1 | for (auto zoneComp = zoneEquipment.begin(); zoneComp != zoneEquipment.end(); ++zoneComp) { |
| 770 | ✗ | if (boost::optional<model::Node> inlet = zoneComp->inletNode()) { | |
| 771 | ✗ | inlet->setName(zoneComp->name().get() + " Inlet Node"); | |
| 772 | ✗ | } | |
| 773 | ✗ | if (boost::optional<model::Node> outlet = zoneComp->outletNode()) { | |
| 774 | ✗ | outlet->setName(zoneComp->name().get() + " Outlet Node"); | |
| 775 | ✗ | } | |
| 776 | } | ||
| 777 | |||
| 778 | // timestep | ||
| 779 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node numTimeStepsPerHrElement = projectElement.child("NumTimeStepsPerHr"); |
| 780 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<int> _numTimeStepsPerHr = lexicalCastToInt(numTimeStepsPerHrElement); |
| 781 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_numTimeStepsPerHr) { |
| 782 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto timestep = result->getUniqueModelObject<model::Timestep>(); |
| 783 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | timestep.setNumberOfTimestepsPerHour(_numTimeStepsPerHr.get()); |
| 784 | 1 | } else { | |
| 785 | ✗ | LOG(Warn, "Cannot cast NumTimeStepsPerHr to an integer, NumTimeStepsPerHr: [" << numTimeStepsPerHrElement.text().as_string() | |
| 786 | << "]. Defaulting to 4/hr."); | ||
| 787 | ✗ | auto timestep = result->getUniqueModelObject<model::Timestep>(); | |
| 788 | ✗ | timestep.setNumberOfTimestepsPerHour(4); | |
| 789 | ✗ | } | |
| 790 | |||
| 791 | // request output meters for TDV calculations | ||
| 792 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | std::set<int> fuelTypes = FuelType::getValues(); |
| 793 |
2/2✓ Branch 5 taken 17 times.
✓ Branch 6 taken 1 time.
|
18 | for (int fuelType : fuelTypes) { |
| 794 | |||
| 795 |
8/8✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 15 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 14 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 13 times.
✓ Branch 7 taken 1 time.
|
17 | if (fuelType == FuelType::Gasoline || fuelType == FuelType::Diesel || fuelType == FuelType::FuelOil_1 || fuelType == FuelType::FuelOil_2 |
| 796 |
8/8✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 11 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 10 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 9 times.
✓ Branch 7 taken 1 time.
|
13 | || fuelType == FuelType::Propane || fuelType == FuelType::Water || fuelType == FuelType::Steam || fuelType == FuelType::OtherFuel_1 |
| 797 |
6/6✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 7 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 6 times.
✓ Branch 5 taken 1 time.
|
9 | || fuelType == FuelType::OtherFuel_2 || fuelType == FuelType::EnergyTransfer || fuelType == FuelType::Geothermal |
| 798 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 5 times.
|
6 | || fuelType == FuelType::Solar) { |
| 799 | // TODO: why are we ignoring these?! Aside from EnergyTransfer, Solar and Geothermal at least | ||
| 800 | // skip these to avoid E+ warning, EnergyTransfer is internal to the simulation | ||
| 801 | 12 | continue; | |
| 802 | } | ||
| 803 | |||
| 804 | // overall meter for this fuel type | ||
| 805 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | model::OutputMeter meter(*result); |
| 806 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | meter.setFuelType(FuelType(fuelType)); |
| 807 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 808 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | meter.setReportingFrequency("Hourly"); |
| 809 | |||
| 810 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | std::set<int> endUseTypes = EndUseType::getValues(); |
| 811 |
2/2✓ Branch 5 taken 105 times.
✓ Branch 6 taken 5 times.
|
110 | for (int endUseType : endUseTypes) { |
| 812 | |||
| 813 |
6/6✓ Branch 0 taken 100 times.
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 95 times.
✓ Branch 3 taken 5 times.
✓ Branch 4 taken 90 times.
✓ Branch 5 taken 5 times.
|
105 | if (endUseType == EndUseType::HeatingCoils || endUseType == EndUseType::CoolingCoils || endUseType == EndUseType::Boilers |
| 814 |
4/4✓ Branch 0 taken 85 times.
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 80 times.
✓ Branch 3 taken 5 times.
|
90 | || endUseType == EndUseType::Baseboard || endUseType == EndUseType::HeatRecoveryForCooling |
| 815 |
2/2✓ Branch 0 taken 5 times.
✓ Branch 1 taken 75 times.
|
80 | || endUseType == EndUseType::HeatRecoveryForHeating) { |
| 816 | // ignore energy transfer meters | ||
| 817 | 30 | continue; | |
| 818 | } | ||
| 819 | |||
| 820 | // meter for this fuel type and end use | ||
| 821 | // DLM: many of these will not be applicable and will cause E+ warnings | ||
| 822 |
2/2✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
|
75 | model::OutputMeter meter(*result); |
| 823 |
2/2✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
|
75 | meter.setFuelType(FuelType(fuelType)); |
| 824 |
2/2✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
|
75 | meter.setEndUseType(EndUseType(endUseType)); |
| 825 |
2/2✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
|
75 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 826 |
2/2✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
|
75 | meter.setReportingFrequency("Hourly"); |
| 827 | 75 | } | |
| 828 | 5 | } | |
| 829 | |||
| 830 | // request specific meters | ||
| 831 | // ElectricEquipment - Receptacle, Process, Refrig | ||
| 832 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | model::OutputMeter meter(*result); |
| 833 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 834 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorEquipment); |
| 835 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Receptacle"); |
| 836 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 837 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 838 | |||
| 839 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 840 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 841 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorEquipment); |
| 842 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Process"); |
| 843 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 844 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 845 | |||
| 846 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 847 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 848 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorEquipment); |
| 849 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Refrig"); |
| 850 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 851 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 852 | |||
| 853 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 854 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 855 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorEquipment); |
| 856 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Internal Transport"); |
| 857 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 858 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 859 | |||
| 860 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 861 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 862 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorEquipment); |
| 863 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Receptacle"); |
| 864 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 865 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 866 | |||
| 867 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 868 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 869 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorEquipment); |
| 870 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Process"); |
| 871 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 872 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 873 | |||
| 874 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 875 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 876 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorEquipment); |
| 877 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Refrig"); |
| 878 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 879 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 880 | |||
| 881 | // GasEquipment - Receptacle, Process | ||
| 882 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 883 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Gas); |
| 884 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorEquipment); |
| 885 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Receptacle"); |
| 886 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 887 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 888 | |||
| 889 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 890 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Gas); |
| 891 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorEquipment); |
| 892 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Process"); |
| 893 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 894 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 895 | |||
| 896 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 897 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Gas); |
| 898 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorEquipment); |
| 899 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Receptacle"); |
| 900 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 901 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 902 | |||
| 903 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 904 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Gas); |
| 905 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorEquipment); |
| 906 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Process"); |
| 907 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 908 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 909 | |||
| 910 | // Lights - ComplianceLtg, NonComplianceLtg | ||
| 911 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 912 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 913 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorLights); |
| 914 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("ComplianceLtg"); |
| 915 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 916 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 917 | |||
| 918 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 919 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 920 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::InteriorLights); |
| 921 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("NonComplianceLtg"); |
| 922 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 923 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 924 | |||
| 925 | // Exterior Lights - Reg Ltg, NonReg Ltg | ||
| 926 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 927 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 928 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorLights); |
| 929 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("Reg Ltg"); |
| 930 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 931 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 932 | |||
| 933 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter = model::OutputMeter(*result); |
| 934 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setFuelType(FuelType::Electricity); |
| 935 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setEndUseType(EndUseType::ExteriorLights); |
| 936 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setSpecificEndUse("NonReg Ltg"); |
| 937 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setInstallLocationType(InstallLocationType::Facility); |
| 938 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency("Hourly"); |
| 939 | |||
| 940 | { | ||
| 941 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto fanZoneExhausts = result->getConcreteModelObjects<model::FanZoneExhaust>(); |
| 942 |
1/1✓ Branch 2 taken 1 time.
|
1 | std::vector<std::string> subCategories(fanZoneExhausts.size()); |
| 943 |
1/1✓ Branch 4 taken 1 time.
|
1 | std::transform(fanZoneExhausts.begin(), fanZoneExhausts.end(), subCategories.begin(), |
| 944 | ✗ | [](const model::FanZoneExhaust& fan) { return fan.endUseSubcategory(); }); | |
| 945 |
1/1✓ Branch 3 taken 1 time.
|
1 | std::sort(subCategories.begin(), subCategories.end()); |
| 946 |
1/1✓ Branch 3 taken 1 time.
|
1 | auto last = std::unique(subCategories.begin(), subCategories.end()); |
| 947 |
1/1✓ Branch 4 taken 1 time.
|
1 | subCategories.erase(last, subCategories.end()); |
| 948 | |||
| 949 |
1/2✗ Branch 4 not taken.
✓ Branch 5 taken 1 time.
|
1 | for (const auto& subcat : subCategories) { |
| 950 | ✗ | meter = model::OutputMeter(*result); | |
| 951 | ✗ | meter.setFuelType(FuelType::Electricity); | |
| 952 | ✗ | meter.setEndUseType(EndUseType::Fans); | |
| 953 | ✗ | meter.setSpecificEndUse(subcat); | |
| 954 | ✗ | meter.setInstallLocationType(InstallLocationType::Facility); | |
| 955 | ✗ | meter.setReportingFrequency("Hourly"); | |
| 956 | } | ||
| 957 | 1 | } | |
| 958 | |||
| 959 | // Output Variables | ||
| 960 | |||
| 961 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsIntervalElement = projectElement.child("SimVarsInterval"); |
| 962 | |||
| 963 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | std::string interval(simVarsIntervalElement.text().as_string()); |
| 964 | |||
| 965 | // SimVarsSite | ||
| 966 | |||
| 967 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsSiteElement = projectElement.child("SimVarsSite"); |
| 968 | |||
| 969 | // Here as_int() is fine, if the key wasn't present or not an int, it'd convert to zero | ||
| 970 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsSiteElement.text().as_int() == 1) { |
| 971 | ✗ | model::OutputVariable var("Site Outdoor Air Drybulb Temperature", *result); | |
| 972 | ✗ | var.setReportingFrequency(interval); | |
| 973 | |||
| 974 | ✗ | var = model::OutputVariable("Site Outdoor Air Wetbulb Temperature", *result); | |
| 975 | ✗ | var.setReportingFrequency(interval); | |
| 976 | |||
| 977 | ✗ | var = model::OutputVariable("Site Direct Solar Radiation Rate per Area", *result); | |
| 978 | ✗ | var.setReportingFrequency(interval); | |
| 979 | |||
| 980 | ✗ | var = model::OutputVariable("Site Diffuse Solar Radiation Rate per Area", *result); | |
| 981 | ✗ | var.setReportingFrequency(interval); | |
| 982 | ✗ | } | |
| 983 | |||
| 984 | // SimVarsDayltg | ||
| 985 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsDayltgElement = projectElement.child("SimVarsDayltg"); |
| 986 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsDayltgElement.text().as_int() == 1) { |
| 987 | ✗ | model::OutputVariable var("Zone Lights Electricity Rate", *result); | |
| 988 | ✗ | var.setReportingFrequency(interval); | |
| 989 | |||
| 990 | ✗ | var = model::OutputVariable("Daylighting Reference Point 1 Illuminance", *result); | |
| 991 | ✗ | var.setReportingFrequency(interval); | |
| 992 | |||
| 993 | ✗ | var = model::OutputVariable("Daylighting Reference Point 2 Illuminance", *result); | |
| 994 | ✗ | var.setReportingFrequency(interval); | |
| 995 | |||
| 996 | ✗ | var = model::OutputVariable("Daylighting Lighting Power Multiplier", *result); | |
| 997 | ✗ | var.setReportingFrequency(interval); | |
| 998 | ✗ | } | |
| 999 | |||
| 1000 | // SimVarsFen | ||
| 1001 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsFenElement = projectElement.child("SimVarsFen"); |
| 1002 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if ((simVarsFenElement.text().as_int() == 1)) { |
| 1003 | ✗ | for (const auto& subSurface : result->getConcreteModelObjects<model::SubSurface>()) { | |
| 1004 | ✗ | std::string subSurfaceType = subSurface.subSurfaceType(); | |
| 1005 | |||
| 1006 | ✗ | if (istringEqual(subSurfaceType, "FixedWindow") || istringEqual(subSurfaceType, "OperableWindow") || istringEqual(subSurfaceType, "GlassDoor") | |
| 1007 | ✗ | || istringEqual(subSurfaceType, "Skylight") || istringEqual(subSurfaceType, "TubularDaylightDome") | |
| 1008 | ✗ | || istringEqual(subSurfaceType, "TubularDaylightDiffuser")) { | |
| 1009 | ✗ | model::OutputVariable var("Surface Window Heat Gain Rate", *result); | |
| 1010 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1011 | ✗ | var.setReportingFrequency(interval); | |
| 1012 | |||
| 1013 | ✗ | var = model::OutputVariable("Surface Window Heat Loss Rate", *result); | |
| 1014 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1015 | ✗ | var.setReportingFrequency(interval); | |
| 1016 | |||
| 1017 | ✗ | var = model::OutputVariable("Surface Inside Face Adjacent Air Temperature", *result); | |
| 1018 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1019 | ✗ | var.setReportingFrequency(interval); | |
| 1020 | |||
| 1021 | ✗ | var = model::OutputVariable("Surface Outside Face Outdoor Air Drybulb Temperature", *result); | |
| 1022 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1023 | ✗ | var.setReportingFrequency(interval); | |
| 1024 | ✗ | } | |
| 1025 | ✗ | } | |
| 1026 | } | ||
| 1027 | |||
| 1028 | // SimVarsDr | ||
| 1029 | |||
| 1030 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsDrElement = projectElement.child("SimVarsDr"); |
| 1031 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if ((simVarsDrElement.text().as_int() == 1)) { |
| 1032 | ✗ | for (const auto& subSurface : result->getConcreteModelObjects<model::SubSurface>()) { | |
| 1033 | ✗ | std::string subSurfaceType = subSurface.subSurfaceType(); | |
| 1034 | |||
| 1035 | ✗ | if (istringEqual(subSurfaceType, "Door") || istringEqual(subSurfaceType, "OverheadDoor")) { | |
| 1036 | ✗ | model::OutputVariable var("Surface Average Face Conduction Heat Gain Rate", *result); | |
| 1037 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1038 | ✗ | var.setReportingFrequency(interval); | |
| 1039 | |||
| 1040 | ✗ | var = model::OutputVariable("Surface Average Face Conduction Heat Loss Rate", *result); | |
| 1041 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1042 | ✗ | var.setReportingFrequency(interval); | |
| 1043 | |||
| 1044 | ✗ | var = model::OutputVariable("Surface Inside Face Adjacent Air Temperature", *result); | |
| 1045 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1046 | ✗ | var.setReportingFrequency(interval); | |
| 1047 | |||
| 1048 | ✗ | var = model::OutputVariable("Surface Outside Face Outdoor Air Drybulb Temperature", *result); | |
| 1049 | ✗ | var.setKeyValue(subSurface.name().get()); | |
| 1050 | ✗ | var.setReportingFrequency(interval); | |
| 1051 | ✗ | } | |
| 1052 | ✗ | } | |
| 1053 | } | ||
| 1054 | |||
| 1055 | // SimVarsThrmlZn | ||
| 1056 | |||
| 1057 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsThrmlZnElement = projectElement.child("SimVarsThrmlZn"); |
| 1058 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsThrmlZnElement.text().as_int() == 1) { |
| 1059 | ✗ | model::OutputVariable var("Zone Air Temperature", *result); | |
| 1060 | ✗ | var.setReportingFrequency(interval); | |
| 1061 | |||
| 1062 | ✗ | std::vector<model::ThermalZone> zones = result->getConcreteModelObjects<model::ThermalZone>(); | |
| 1063 | ✗ | for (auto it = zones.begin(); it != zones.end(); ++it) { | |
| 1064 | ✗ | if (boost::optional<model::ModelObject> returnAirNode = it->returnAirModelObject()) { | |
| 1065 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1066 | ✗ | var.setReportingFrequency(interval); | |
| 1067 | ✗ | var.setKeyValue(returnAirNode->name().get()); | |
| 1068 | |||
| 1069 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1070 | ✗ | var.setReportingFrequency(interval); | |
| 1071 | ✗ | var.setKeyValue(returnAirNode->name().get()); | |
| 1072 | ✗ | } | |
| 1073 | |||
| 1074 | ✗ | std::vector<model::ModelObject> objects = it->inletPortList().modelObjects(); | |
| 1075 | ✗ | for (auto inletIt = objects.begin(); inletIt != objects.end(); ++inletIt) { | |
| 1076 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1077 | ✗ | var.setReportingFrequency(interval); | |
| 1078 | ✗ | var.setKeyValue(inletIt->name().get()); | |
| 1079 | |||
| 1080 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1081 | ✗ | var.setReportingFrequency(interval); | |
| 1082 | ✗ | var.setKeyValue(inletIt->name().get()); | |
| 1083 | } | ||
| 1084 | |||
| 1085 | ✗ | objects = it->exhaustPortList().modelObjects(); | |
| 1086 | ✗ | for (auto exhIt = objects.begin(); exhIt != objects.end(); ++exhIt) { | |
| 1087 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1088 | ✗ | var.setReportingFrequency(interval); | |
| 1089 | ✗ | var.setKeyValue(exhIt->name().get()); | |
| 1090 | |||
| 1091 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1092 | ✗ | var.setReportingFrequency(interval); | |
| 1093 | ✗ | var.setKeyValue(exhIt->name().get()); | |
| 1094 | } | ||
| 1095 | ✗ | } | |
| 1096 | ✗ | } | |
| 1097 | |||
| 1098 | // SimVarsVRFSys | ||
| 1099 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsVRFSys = projectElement.child("SimVarsVRFSys"); |
| 1100 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsVRFSys.text().as_int() == 1) { |
| 1101 | ✗ | model::OutputVariable var("VRF Heat Pump Total Cooling Rate", *result); | |
| 1102 | ✗ | var.setReportingFrequency(interval); | |
| 1103 | ✗ | var = model::OutputVariable("VRF Heat Pump Total Heating Rate", *result); | |
| 1104 | ✗ | var.setReportingFrequency(interval); | |
| 1105 | ✗ | var = model::OutputVariable("VRF Heat Pump Cooling Electricity Rate", *result); | |
| 1106 | ✗ | var.setReportingFrequency(interval); | |
| 1107 | ✗ | var = model::OutputVariable("VRF Heat Pump Heating Electricity Rate", *result); | |
| 1108 | ✗ | var.setReportingFrequency(interval); | |
| 1109 | ✗ | var = model::OutputVariable("VRF Heat Pump Cooling COP", *result); | |
| 1110 | ✗ | var.setReportingFrequency(interval); | |
| 1111 | ✗ | var = model::OutputVariable("VRF Heat Pump Heating COP", *result); | |
| 1112 | ✗ | var.setReportingFrequency(interval); | |
| 1113 | ✗ | var = model::OutputVariable("VRF Heat Pump COP", *result); | |
| 1114 | ✗ | var.setReportingFrequency(interval); | |
| 1115 | ✗ | var = model::OutputVariable("VRF Heat Pump Defrost Electricity Rate", *result); | |
| 1116 | ✗ | var.setReportingFrequency(interval); | |
| 1117 | ✗ | var = model::OutputVariable("VRF Heat Pump Part Load Ratio", *result); | |
| 1118 | ✗ | var.setReportingFrequency(interval); | |
| 1119 | ✗ | var = model::OutputVariable("VRF Heat Pump Runtime Fraction", *result); | |
| 1120 | ✗ | var.setReportingFrequency(interval); | |
| 1121 | ✗ | var = model::OutputVariable("VRF Heat Pump Cycling Ratio", *result); | |
| 1122 | ✗ | var.setReportingFrequency(interval); | |
| 1123 | ✗ | var = model::OutputVariable("VRF Heat Pump Operating Mode", *result); | |
| 1124 | ✗ | var.setReportingFrequency(interval); | |
| 1125 | ✗ | var = model::OutputVariable("VRF Heat Pump Condenser Inlet Temperature", *result); | |
| 1126 | ✗ | var.setReportingFrequency(interval); | |
| 1127 | ✗ | var = model::OutputVariable("VRF Heat Pump Maximum Capacity Cooling Rate", *result); | |
| 1128 | ✗ | var.setReportingFrequency(interval); | |
| 1129 | ✗ | var = model::OutputVariable("VRF Heat Pump Maximum Capacity Heating Rate", *result); | |
| 1130 | ✗ | var.setReportingFrequency(interval); | |
| 1131 | ✗ | var = model::OutputVariable("VRF Heat Pump Crankcase Heater Electricity Rate", *result); | |
| 1132 | ✗ | var.setReportingFrequency(interval); | |
| 1133 | ✗ | var = model::OutputVariable("VRF Heat Pump Terminal Unit Cooling Load Rate", *result); | |
| 1134 | ✗ | var.setReportingFrequency(interval); | |
| 1135 | ✗ | var = model::OutputVariable("VRF Heat Pump Terminal Unit Heating Load Rate", *result); | |
| 1136 | ✗ | var.setReportingFrequency(interval); | |
| 1137 | ✗ | var = model::OutputVariable("VRF Heat Pump Heat Recovery Status Change Multiplier", *result); | |
| 1138 | ✗ | var.setReportingFrequency(interval); | |
| 1139 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Cooling Electricity Rate", *result); | |
| 1140 | ✗ | var.setReportingFrequency(interval); | |
| 1141 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Total Cooling Rate", *result); | |
| 1142 | ✗ | var.setReportingFrequency(interval); | |
| 1143 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Sensible Cooling Rate", *result); | |
| 1144 | ✗ | var.setReportingFrequency(interval); | |
| 1145 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Latent Cooling Rate", *result); | |
| 1146 | ✗ | var.setReportingFrequency(interval); | |
| 1147 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Heating Electricity Rate", *result); | |
| 1148 | ✗ | var.setReportingFrequency(interval); | |
| 1149 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Total Heating Rate", *result); | |
| 1150 | ✗ | var.setReportingFrequency(interval); | |
| 1151 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Sensible Heating Rate", *result); | |
| 1152 | ✗ | var.setReportingFrequency(interval); | |
| 1153 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Latent Heating Rate", *result); | |
| 1154 | ✗ | var.setReportingFrequency(interval); | |
| 1155 | ✗ | var = model::OutputVariable("Zone VRF Air Terminal Fan Availability Status", *result); | |
| 1156 | ✗ | var.setReportingFrequency(interval); | |
| 1157 | ✗ | } | |
| 1158 | |||
| 1159 | // SimVarsHVACZn | ||
| 1160 | |||
| 1161 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsHVACZnElement = projectElement.child("SimVarsHVACZn"); |
| 1162 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsHVACZnElement.text().as_int() == 1) { |
| 1163 | ✗ | model::OutputVariable var("Zone Air Terminal VAV Damper Position", *result); | |
| 1164 | ✗ | var.setReportingFrequency(interval); | |
| 1165 | |||
| 1166 | ✗ | var = model::OutputVariable("Zone Air Terminal Outdoor Air Volume Flow Rate", *result); | |
| 1167 | ✗ | var.setReportingFrequency(interval); | |
| 1168 | |||
| 1169 | ✗ | var = model::OutputVariable("Zone Packaged Terminal Heat Pump Total Heating Rate", *result); | |
| 1170 | ✗ | var.setReportingFrequency(interval); | |
| 1171 | |||
| 1172 | ✗ | var = model::OutputVariable("Zone Packaged Terminal Heat Pump Total Cooling Rate", *result); | |
| 1173 | ✗ | var.setReportingFrequency(interval); | |
| 1174 | |||
| 1175 | ✗ | var = model::OutputVariable("Zone Packaged Terminal Air Conditioner Total Heating Rate", *result); | |
| 1176 | ✗ | var.setReportingFrequency(interval); | |
| 1177 | |||
| 1178 | ✗ | var = model::OutputVariable("Zone Packaged Terminal Air Conditioner Total Cooling Rate", *result); | |
| 1179 | ✗ | var.setReportingFrequency(interval); | |
| 1180 | |||
| 1181 | ✗ | var = model::OutputVariable("Baseboard Total Heating Rate", *result); | |
| 1182 | ✗ | var.setReportingFrequency(interval); | |
| 1183 | |||
| 1184 | ✗ | auto createOutputForNode = [&](const std::string& nodename) { | |
| 1185 | ✗ | auto var = model::OutputVariable("System Node Temperature", *result); | |
| 1186 | ✗ | var.setReportingFrequency(interval); | |
| 1187 | ✗ | var.setKeyValue(nodename); | |
| 1188 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1189 | ✗ | var.setReportingFrequency(interval); | |
| 1190 | ✗ | var.setKeyValue(nodename); | |
| 1191 | ✗ | }; | |
| 1192 | |||
| 1193 | ✗ | auto createOutputForZoneHVAC = [&](const model::ZoneHVACComponent& comp) { | |
| 1194 | ✗ | auto name = comp.name().get(); | |
| 1195 | ✗ | if (auto mo = comp.inletNode()) { | |
| 1196 | ✗ | createOutputForNode(mo->name().get()); | |
| 1197 | ✗ | } | |
| 1198 | ✗ | if (auto mo = comp.outletNode()) { | |
| 1199 | ✗ | createOutputForNode(mo->name().get()); | |
| 1200 | ✗ | } | |
| 1201 | ✗ | auto mixedAirNodeName = name + " Mixed Air Node"; | |
| 1202 | ✗ | createOutputForNode(mixedAirNodeName); | |
| 1203 | ✗ | auto reliefAirNodeName = name + " Relief Air Node"; | |
| 1204 | ✗ | createOutputForNode(reliefAirNodeName); | |
| 1205 | ✗ | auto oaNodeName = name + " OA Node"; | |
| 1206 | ✗ | createOutputForNode(oaNodeName); | |
| 1207 | ✗ | }; | |
| 1208 | |||
| 1209 | // Really need some abstraction so this sillyness isn't required | ||
| 1210 | { | ||
| 1211 | ✗ | auto zonehvac = result->getConcreteModelObjects<model::ZoneHVACPackagedTerminalAirConditioner>(); | |
| 1212 | ✗ | for (const auto& comp : zonehvac) { | |
| 1213 | ✗ | createOutputForZoneHVAC(comp); | |
| 1214 | } | ||
| 1215 | ✗ | } | |
| 1216 | { | ||
| 1217 | ✗ | auto zonehvac = result->getConcreteModelObjects<model::ZoneHVACPackagedTerminalHeatPump>(); | |
| 1218 | ✗ | for (const auto& comp : zonehvac) { | |
| 1219 | ✗ | createOutputForZoneHVAC(comp); | |
| 1220 | } | ||
| 1221 | ✗ | } | |
| 1222 | { | ||
| 1223 | ✗ | auto zonehvac = result->getConcreteModelObjects<model::ZoneHVACWaterToAirHeatPump>(); | |
| 1224 | ✗ | for (const auto& comp : zonehvac) { | |
| 1225 | ✗ | createOutputForZoneHVAC(comp); | |
| 1226 | |||
| 1227 | ✗ | var = model::OutputVariable("Zone Water to Air Heat Pump Total Heating Rate", *result); | |
| 1228 | ✗ | var.setReportingFrequency(interval); | |
| 1229 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1230 | |||
| 1231 | ✗ | var = model::OutputVariable("Zone Water to Air Heat Pump Total Cooling Rate", *result); | |
| 1232 | ✗ | var.setReportingFrequency(interval); | |
| 1233 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1234 | |||
| 1235 | ✗ | var = model::OutputVariable("Zone Water to Air Heat Pump Total Cooling Rate", *result); | |
| 1236 | ✗ | var.setReportingFrequency(interval); | |
| 1237 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1238 | |||
| 1239 | ✗ | var = model::OutputVariable("Zone Water to Air Heat Pump Sensible Cooling Rate", *result); | |
| 1240 | ✗ | var.setReportingFrequency(interval); | |
| 1241 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1242 | |||
| 1243 | ✗ | var = model::OutputVariable("Zone Water to Air Heat Pump Electricity Rate", *result); | |
| 1244 | ✗ | var.setReportingFrequency(interval); | |
| 1245 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1246 | |||
| 1247 | ✗ | var = model::OutputVariable("Zone Water to Air Heat Pump Compressor Part Load Ratio", *result); | |
| 1248 | ✗ | var.setReportingFrequency(interval); | |
| 1249 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1250 | } | ||
| 1251 | ✗ | } | |
| 1252 | { | ||
| 1253 | ✗ | auto zonehvac = result->getConcreteModelObjects<model::ZoneHVACFourPipeFanCoil>(); | |
| 1254 | ✗ | for (const auto& comp : zonehvac) { | |
| 1255 | ✗ | createOutputForZoneHVAC(comp); | |
| 1256 | } | ||
| 1257 | ✗ | } | |
| 1258 | { | ||
| 1259 | ✗ | auto zonehvac = result->getConcreteModelObjects<model::ZoneHVACBaseboardConvectiveElectric>(); | |
| 1260 | ✗ | for (const auto& comp : zonehvac) { | |
| 1261 | ✗ | var = model::OutputVariable("Baseboard Electricity Rate", *result); | |
| 1262 | ✗ | var.setReportingFrequency(interval); | |
| 1263 | ✗ | var.setKeyValue(comp.nameString()); | |
| 1264 | } | ||
| 1265 | ✗ | } | |
| 1266 | ✗ | } | |
| 1267 | |||
| 1268 | // SimVarsHVACSec | ||
| 1269 | |||
| 1270 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsHVACSecElement = projectElement.child("SimVarsHVACSec"); |
| 1271 | |||
| 1272 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsHVACSecElement.text().as_int() == 1) { |
| 1273 | ✗ | model::OutputVariable var("Heating Coil Air Heating Rate", *result); | |
| 1274 | ✗ | var.setReportingFrequency(interval); | |
| 1275 | |||
| 1276 | ✗ | var = model::OutputVariable("Heating Coil Heating Rate", *result); | |
| 1277 | ✗ | var.setReportingFrequency(interval); | |
| 1278 | |||
| 1279 | ✗ | var = model::OutputVariable("Cooling Coil Total Cooling Rate", *result); | |
| 1280 | ✗ | var.setReportingFrequency(interval); | |
| 1281 | |||
| 1282 | ✗ | var = model::OutputVariable("Cooling Coil Sensible Cooling Rate", *result); | |
| 1283 | ✗ | var.setReportingFrequency(interval); | |
| 1284 | |||
| 1285 | ✗ | var = model::OutputVariable("Cooling Coil Electricity Rate", *result); | |
| 1286 | ✗ | var.setReportingFrequency(interval); | |
| 1287 | |||
| 1288 | ✗ | var = model::OutputVariable("Cooling Coil Part Load Ratio", *result); | |
| 1289 | ✗ | var.setReportingFrequency(interval); | |
| 1290 | |||
| 1291 | ✗ | var = model::OutputVariable("Cooling Coil Runtime Fraction", *result); | |
| 1292 | ✗ | var.setReportingFrequency(interval); | |
| 1293 | |||
| 1294 | ✗ | var = model::OutputVariable("Fan Electricity Rate", *result); | |
| 1295 | ✗ | var.setReportingFrequency(interval); | |
| 1296 | |||
| 1297 | ✗ | var = model::OutputVariable("Heating Coil NaturalGas Rate", *result); | |
| 1298 | ✗ | var.setReportingFrequency(interval); | |
| 1299 | |||
| 1300 | ✗ | var = model::OutputVariable("Heating Coil Electricity Rate", *result); | |
| 1301 | ✗ | var.setReportingFrequency(interval); | |
| 1302 | |||
| 1303 | ✗ | var = model::OutputVariable("Heating Coil Runtime Fraction", *result); | |
| 1304 | ✗ | var.setReportingFrequency(interval); | |
| 1305 | |||
| 1306 | ✗ | var = model::OutputVariable("Heating Coil Part Load Ratio", *result); | |
| 1307 | ✗ | var.setReportingFrequency(interval); | |
| 1308 | |||
| 1309 | ✗ | var = model::OutputVariable("Evaporative Cooler Electricity Rate", *result); | |
| 1310 | ✗ | var.setReportingFrequency(interval); | |
| 1311 | |||
| 1312 | ✗ | var = model::OutputVariable("Heating Coil Total Heating Rate", *result); | |
| 1313 | ✗ | var.setReportingFrequency(interval); | |
| 1314 | |||
| 1315 | ✗ | var = model::OutputVariable("Air System Outdoor Air Heat Recovery Bypass Status", *result); | |
| 1316 | ✗ | var.setReportingFrequency(interval); | |
| 1317 | |||
| 1318 | ✗ | var = model::OutputVariable("Air System Outdoor Air Economizer Status", *result); | |
| 1319 | ✗ | var.setReportingFrequency(interval); | |
| 1320 | |||
| 1321 | ✗ | auto hxs = result->getConcreteModelObjects<model::HeatExchangerAirToAirSensibleAndLatent>(); | |
| 1322 | ✗ | for (auto& hx : hxs) { | |
| 1323 | ✗ | var = model::OutputVariable("Heat Exchanger Sensible Heating Rate", *result); | |
| 1324 | ✗ | var.setReportingFrequency(interval); | |
| 1325 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1326 | ✗ | var = model::OutputVariable("Heat Exchanger Latent Gain Rate", *result); | |
| 1327 | ✗ | var.setReportingFrequency(interval); | |
| 1328 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1329 | ✗ | var = model::OutputVariable("Heat Exchanger Total Heating Rate", *result); | |
| 1330 | ✗ | var.setReportingFrequency(interval); | |
| 1331 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1332 | ✗ | var = model::OutputVariable("Heat Exchanger Sensible Cooling Rate", *result); | |
| 1333 | ✗ | var.setReportingFrequency(interval); | |
| 1334 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1335 | ✗ | var = model::OutputVariable("Heat Exchanger Latent Cooling Rate", *result); | |
| 1336 | ✗ | var.setReportingFrequency(interval); | |
| 1337 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1338 | ✗ | var = model::OutputVariable("Heat Exchanger Total Cooling Rate", *result); | |
| 1339 | ✗ | var.setReportingFrequency(interval); | |
| 1340 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1341 | ✗ | var = model::OutputVariable("Heat Exchanger Electricity Rate", *result); | |
| 1342 | ✗ | var.setReportingFrequency(interval); | |
| 1343 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1344 | ✗ | var = model::OutputVariable("Heat Exchanger Sensible Effectiveness", *result); | |
| 1345 | ✗ | var.setReportingFrequency(interval); | |
| 1346 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1347 | ✗ | var = model::OutputVariable("Heat Exchanger Latent Effectiveness", *result); | |
| 1348 | ✗ | var.setReportingFrequency(interval); | |
| 1349 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1350 | ✗ | var = model::OutputVariable("Heat Exchanger Supply Air Bypass Mass Flow Rate", *result); | |
| 1351 | ✗ | var.setReportingFrequency(interval); | |
| 1352 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1353 | ✗ | var = model::OutputVariable("Heat Exchanger Exhaust Air Bypass Mass Flow Rate", *result); | |
| 1354 | ✗ | var.setReportingFrequency(interval); | |
| 1355 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1356 | ✗ | var = model::OutputVariable("Heat Exchanger Defrost Time Fraction", *result); | |
| 1357 | ✗ | var.setReportingFrequency(interval); | |
| 1358 | ✗ | var.setKeyValue(hx.nameString()); | |
| 1359 | |||
| 1360 | ✗ | if (auto node = hx.primaryAirOutletModelObject()) { | |
| 1361 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1362 | ✗ | var.setReportingFrequency(interval); | |
| 1363 | ✗ | var.setKeyValue(node->name().get()); | |
| 1364 | |||
| 1365 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1366 | ✗ | var.setReportingFrequency(interval); | |
| 1367 | ✗ | var.setKeyValue(node->name().get()); | |
| 1368 | ✗ | } | |
| 1369 | |||
| 1370 | ✗ | if (auto node = hx.secondaryAirOutletModelObject()) { | |
| 1371 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1372 | ✗ | var.setReportingFrequency(interval); | |
| 1373 | ✗ | var.setKeyValue(node->name().get()); | |
| 1374 | |||
| 1375 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1376 | ✗ | var.setReportingFrequency(interval); | |
| 1377 | ✗ | var.setKeyValue(node->name().get()); | |
| 1378 | ✗ | } | |
| 1379 | } | ||
| 1380 | |||
| 1381 | ✗ | std::vector<model::AirLoopHVAC> airloops = result->getConcreteModelObjects<model::AirLoopHVAC>(); | |
| 1382 | ✗ | for (auto& airloop : airloops) { | |
| 1383 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1384 | ✗ | var.setReportingFrequency(interval); | |
| 1385 | ✗ | var.setKeyValue(airloop.supplyInletNode().name().get()); | |
| 1386 | |||
| 1387 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1388 | ✗ | var.setReportingFrequency(interval); | |
| 1389 | ✗ | var.setKeyValue(airloop.supplyOutletNode().name().get()); | |
| 1390 | |||
| 1391 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1392 | ✗ | var.setReportingFrequency(interval); | |
| 1393 | ✗ | var.setKeyValue(airloop.supplyOutletNode().name().get()); | |
| 1394 | |||
| 1395 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1396 | ✗ | var.setReportingFrequency(interval); | |
| 1397 | ✗ | var.setKeyValue(airloop.demandInletNode().name().get()); | |
| 1398 | |||
| 1399 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1400 | ✗ | var.setReportingFrequency(interval); | |
| 1401 | ✗ | var.setKeyValue(airloop.demandInletNode().name().get()); | |
| 1402 | |||
| 1403 | ✗ | if (boost::optional<model::Node> node = airloop.mixedAirNode()) { | |
| 1404 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1405 | ✗ | var.setReportingFrequency(interval); | |
| 1406 | ✗ | var.setKeyValue(node->name().get()); | |
| 1407 | |||
| 1408 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1409 | ✗ | var.setReportingFrequency(interval); | |
| 1410 | ✗ | var.setKeyValue(node->name().get()); | |
| 1411 | ✗ | } | |
| 1412 | |||
| 1413 | ✗ | if (boost::optional<model::AirLoopHVACOutdoorAirSystem> oaSystem = airloop.airLoopHVACOutdoorAirSystem()) { | |
| 1414 | ✗ | if (boost::optional<model::ModelObject> node = oaSystem->reliefAirModelObject()) { | |
| 1415 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1416 | ✗ | var.setReportingFrequency(interval); | |
| 1417 | ✗ | var.setKeyValue(node->name().get()); | |
| 1418 | |||
| 1419 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1420 | ✗ | var.setReportingFrequency(interval); | |
| 1421 | ✗ | var.setKeyValue(node->name().get()); | |
| 1422 | ✗ | } | |
| 1423 | |||
| 1424 | ✗ | if (boost::optional<model::Node> node = oaSystem->outboardOANode()) { | |
| 1425 | ✗ | var = model::OutputVariable("System Node Temperature", *result); | |
| 1426 | ✗ | var.setReportingFrequency(interval); | |
| 1427 | ✗ | var.setKeyValue(node->name().get()); | |
| 1428 | |||
| 1429 | ✗ | var = model::OutputVariable("System Node Standard Density Volume Flow Rate", *result); | |
| 1430 | ✗ | var.setReportingFrequency(interval); | |
| 1431 | ✗ | var.setKeyValue(node->name().get()); | |
| 1432 | ✗ | } | |
| 1433 | ✗ | } | |
| 1434 | } | ||
| 1435 | ✗ | } | |
| 1436 | |||
| 1437 | // SimVarsHVACPri | ||
| 1438 | |||
| 1439 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsHVACPriElement = projectElement.child("SimVarsHVACPri"); |
| 1440 | |||
| 1441 |
6/9✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 time.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 time.
|
1 | if ((simVarsHVACPriElement.text().as_int() == 1) || autosize()) { |
| 1442 | ✗ | model::OutputVariable var("Chiller Evaporator Cooling Rate", *result); | |
| 1443 | ✗ | var.setReportingFrequency(interval); | |
| 1444 | |||
| 1445 | ✗ | var = model::OutputVariable("Cooling Tower Heat Transfer Rate", *result); | |
| 1446 | ✗ | var.setReportingFrequency(interval); | |
| 1447 | |||
| 1448 | ✗ | var = model::OutputVariable("Boiler Heating Rate", *result); | |
| 1449 | ✗ | var.setReportingFrequency(interval); | |
| 1450 | ✗ | } | |
| 1451 | |||
| 1452 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsHVACPriElement.text().as_int() == 1) { |
| 1453 | ✗ | model::OutputVariable var("Pump Electricity Rate", *result); | |
| 1454 | ✗ | var.setReportingFrequency(interval); | |
| 1455 | |||
| 1456 | ✗ | var = model::OutputVariable("Pump Mass Flow Rate", *result); | |
| 1457 | ✗ | var.setReportingFrequency(interval); | |
| 1458 | |||
| 1459 | ✗ | var = model::OutputVariable("Pump Outlet Temperature", *result); | |
| 1460 | ✗ | var.setReportingFrequency(interval); | |
| 1461 | |||
| 1462 | ✗ | var = model::OutputVariable("Debug Plant Loop Bypass Fraction", *result); | |
| 1463 | ✗ | var.setReportingFrequency(interval); | |
| 1464 | |||
| 1465 | ✗ | var = model::OutputVariable("Debug Plant Loop Bypass Fraction", *result); | |
| 1466 | ✗ | var.setReportingFrequency(interval); | |
| 1467 | |||
| 1468 | ✗ | var = model::OutputVariable("Chiller Condenser Heat Transfer Rate", *result); | |
| 1469 | ✗ | var.setReportingFrequency(interval); | |
| 1470 | |||
| 1471 | ✗ | var = model::OutputVariable("Chiller Electricity Rate", *result); | |
| 1472 | ✗ | var.setReportingFrequency(interval); | |
| 1473 | |||
| 1474 | ✗ | var = model::OutputVariable("Cooling Tower Heat Transfer Rate", *result); | |
| 1475 | ✗ | var.setReportingFrequency(interval); | |
| 1476 | |||
| 1477 | ✗ | var = model::OutputVariable("Cooling Tower Fan Electricity Rate", *result); | |
| 1478 | ✗ | var.setReportingFrequency(interval); | |
| 1479 | |||
| 1480 | ✗ | var = model::OutputVariable("Boiler NaturalGas Rate", *result); | |
| 1481 | ✗ | var.setReportingFrequency(interval); | |
| 1482 | |||
| 1483 | ✗ | var = model::OutputVariable("Boiler Ancillary Electricity Rate", *result); | |
| 1484 | ✗ | var.setReportingFrequency(interval); | |
| 1485 | |||
| 1486 | ✗ | var = model::OutputVariable("Plant Supply Side Cooling Demand Rate", *result); | |
| 1487 | ✗ | var.setReportingFrequency(interval); | |
| 1488 | |||
| 1489 | ✗ | var = model::OutputVariable("Plant Supply Side Heating Demand Rate", *result); | |
| 1490 | ✗ | var.setReportingFrequency(interval); | |
| 1491 | |||
| 1492 | ✗ | var = model::OutputVariable("Chiller Evaporator Cooling Rate", *result); | |
| 1493 | ✗ | var.setReportingFrequency(interval); | |
| 1494 | |||
| 1495 | ✗ | var = model::OutputVariable("Boiler Heating Rate", *result); | |
| 1496 | ✗ | var.setReportingFrequency(interval); | |
| 1497 | |||
| 1498 | ✗ | var = model::OutputVariable("Plant Supply Side Inlet Temperature", *result); | |
| 1499 | ✗ | var.setReportingFrequency(interval); | |
| 1500 | |||
| 1501 | ✗ | var = model::OutputVariable("Plant Supply Side Outlet Temperature", *result); | |
| 1502 | ✗ | var.setReportingFrequency(interval); | |
| 1503 | |||
| 1504 | ✗ | std::vector<model::PlantLoop> plants = result->getConcreteModelObjects<model::PlantLoop>(); | |
| 1505 | ✗ | for (auto& plant : plants) { | |
| 1506 | ✗ | var = model::OutputVariable("System Node Mass Flow Rate", *result); | |
| 1507 | ✗ | var.setReportingFrequency(interval); | |
| 1508 | ✗ | var.setKeyValue(plant.demandOutletNode().name().get()); | |
| 1509 | } | ||
| 1510 | ✗ | } | |
| 1511 | |||
| 1512 | // SimVarsWtrHtrSys | ||
| 1513 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsWtrHtrSys = projectElement.child("SimVarsWtrHtr"); |
| 1514 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsWtrHtrSys.text().as_int() == 1) { |
| 1515 | ✗ | model::OutputVariable var("Water Heater Tank Temperature", *result); | |
| 1516 | ✗ | var.setReportingFrequency(interval); | |
| 1517 | |||
| 1518 | ✗ | var = model::OutputVariable("Water Heater Electricity Energy", *result); | |
| 1519 | ✗ | var.setReportingFrequency(interval); | |
| 1520 | |||
| 1521 | ✗ | var = model::OutputVariable("Water Heater Electricity Rate", *result); | |
| 1522 | ✗ | var.setReportingFrequency(interval); | |
| 1523 | |||
| 1524 | ✗ | var = model::OutputVariable("Water Heater Heating Energy", *result); | |
| 1525 | ✗ | var.setReportingFrequency(interval); | |
| 1526 | |||
| 1527 | ✗ | var = model::OutputVariable("Water Heater Heating Rate", *result); | |
| 1528 | ✗ | var.setReportingFrequency(interval); | |
| 1529 | |||
| 1530 | ✗ | var = model::OutputVariable("Water Heater Mains Water Volume", *result); | |
| 1531 | ✗ | var.setReportingFrequency(interval); | |
| 1532 | |||
| 1533 | ✗ | var = model::OutputVariable("Water Heater Use Side Inlet Temperature", *result); | |
| 1534 | ✗ | var.setReportingFrequency(interval); | |
| 1535 | |||
| 1536 | ✗ | var = model::OutputVariable("Water Heater Use Side Outlet Temperature", *result); | |
| 1537 | ✗ | var.setReportingFrequency(interval); | |
| 1538 | |||
| 1539 | ✗ | var = model::OutputVariable("Water Heater Use Side Mass Flow Rate", *result); | |
| 1540 | ✗ | var.setReportingFrequency(interval); | |
| 1541 | |||
| 1542 | ✗ | var = model::OutputVariable("Water Heater Use Side Heat Transfer Rate", *result); | |
| 1543 | ✗ | var.setReportingFrequency(interval); | |
| 1544 | |||
| 1545 | ✗ | var = model::OutputVariable("Water Heater Source Side Inlet Temperature", *result); | |
| 1546 | ✗ | var.setReportingFrequency(interval); | |
| 1547 | |||
| 1548 | ✗ | var = model::OutputVariable("Water Heater Source Side Outlet Temperature", *result); | |
| 1549 | ✗ | var.setReportingFrequency(interval); | |
| 1550 | |||
| 1551 | ✗ | var = model::OutputVariable("Water Heater Source Side Mass Flow Rate", *result); | |
| 1552 | ✗ | var.setReportingFrequency(interval); | |
| 1553 | |||
| 1554 | ✗ | var = model::OutputVariable("Water Heater Source Side Heat Transfer Rate", *result); | |
| 1555 | ✗ | var.setReportingFrequency(interval); | |
| 1556 | |||
| 1557 | ✗ | var = model::OutputVariable("Water Heater Water Volume Flow Rate", *result); | |
| 1558 | ✗ | var.setReportingFrequency(interval); | |
| 1559 | |||
| 1560 | ✗ | var = model::OutputVariable("Water Heater Heat Pump Control Tank Final Temperature", *result); | |
| 1561 | ✗ | var.setReportingFrequency(interval); | |
| 1562 | |||
| 1563 | ✗ | var = model::OutputVariable("Water Heater Heat Pump Control Tank Temperature", *result); | |
| 1564 | ✗ | var.setReportingFrequency(interval); | |
| 1565 | |||
| 1566 | ✗ | var = model::OutputVariable("Water Heater NaturalGas Rate", *result); | |
| 1567 | ✗ | var.setReportingFrequency(interval); | |
| 1568 | |||
| 1569 | ✗ | var = model::OutputVariable("Water Heater NaturalGas Energy", *result); | |
| 1570 | ✗ | var.setReportingFrequency(interval); | |
| 1571 | ✗ | } | |
| 1572 | |||
| 1573 | // SimVarsThrmlEngyStor | ||
| 1574 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node simVarsThrmlEngyStorElement = projectElement.child("SimVarsThrmlEngyStor"); |
| 1575 | |||
| 1576 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (simVarsThrmlEngyStorElement.text().as_int() == 1) { |
| 1577 | ✗ | model::OutputVariable var("Chilled Water Thermal Storage Tank Temperature", *result); | |
| 1578 | ✗ | var.setReportingFrequency(interval); | |
| 1579 | |||
| 1580 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Use Side Mass Flow Rate", *result); | |
| 1581 | ✗ | var.setReportingFrequency(interval); | |
| 1582 | |||
| 1583 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Use Side Inlet Temperature", *result); | |
| 1584 | ✗ | var.setReportingFrequency(interval); | |
| 1585 | |||
| 1586 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Use Side Outlet Temperature", *result); | |
| 1587 | ✗ | var.setReportingFrequency(interval); | |
| 1588 | |||
| 1589 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Use Side Heat Transfer Rate", *result); | |
| 1590 | ✗ | var.setReportingFrequency(interval); | |
| 1591 | |||
| 1592 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Use Side Heat Transfer Energy", *result); | |
| 1593 | ✗ | var.setReportingFrequency(interval); | |
| 1594 | |||
| 1595 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Source Side Mass Flow Rate", *result); | |
| 1596 | ✗ | var.setReportingFrequency(interval); | |
| 1597 | |||
| 1598 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Source Side Inlet Temperature", *result); | |
| 1599 | ✗ | var.setReportingFrequency(interval); | |
| 1600 | |||
| 1601 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Source Side Outlet Temperature", *result); | |
| 1602 | ✗ | var.setReportingFrequency(interval); | |
| 1603 | |||
| 1604 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Source Side Heat Transfer Rate", *result); | |
| 1605 | ✗ | var.setReportingFrequency(interval); | |
| 1606 | |||
| 1607 | ✗ | var = model::OutputVariable("Chilled Water Thermal Storage Source Side Heat Transfer Energy", *result); | |
| 1608 | ✗ | var.setReportingFrequency(interval); | |
| 1609 | ✗ | } | |
| 1610 | |||
| 1611 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto rt = result->getUniqueModelObject<model::OutputControlReportingTolerances>(); |
| 1612 |
1/1✓ Branch 1 taken 1 time.
|
1 | rt.setToleranceforTimeCoolingSetpointNotMet(0.56); |
| 1613 |
1/1✓ Branch 1 taken 1 time.
|
1 | rt.setToleranceforTimeHeatingSetpointNotMet(0.56); |
| 1614 | |||
| 1615 |
1/1✓ Branch 1 taken 1 time.
|
1 | return result; |
| 1616 | 1 | } | |
| 1617 | |||
| 1618 | 1 | boost::optional<openstudio::model::ModelObject> ReverseTranslator::translateRunPeriod(const pugi::xml_node& element, | |
| 1619 | openstudio::model::Model& model) { | ||
| 1620 | //<HVACAutoSizing>1</HVACAutoSizing> | ||
| 1621 | //<SimDsgnDays>0</SimDsgnDays> | ||
| 1622 | //<RunPeriodBeginMonth>1</RunPeriodBeginMonth> | ||
| 1623 | //<RunPeriodBeginDay>1</RunPeriodBeginDay> | ||
| 1624 | //<RunPeriodEndMonth>12</RunPeriodEndMonth> | ||
| 1625 | //<RunPeriodEndDay>31</RunPeriodEndDay> | ||
| 1626 | //<RunPeriodYear>1991</RunPeriodYear> | ||
| 1627 | |||
| 1628 | 1 | boost::optional<openstudio::model::ModelObject> result; | |
| 1629 | |||
| 1630 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node hvacAutoSizingElement = element.child("HVACAutoSizing"); |
| 1631 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node runDesignDaysElement = element.child("SimDsgnDays"); |
| 1632 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node beginMonthElement = element.child("RunPeriodBeginMonth"); |
| 1633 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node beginDayElement = element.child("RunPeriodBeginDay"); |
| 1634 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node endMonthElement = element.child("RunPeriodEndMonth"); |
| 1635 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node endDayElement = element.child("RunPeriodEndDay"); |
| 1636 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node yearElement = element.child("RunPeriodYear"); |
| 1637 | |||
| 1638 | 1 | bool test = true; | |
| 1639 | |||
| 1640 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!hvacAutoSizingElement) { |
| 1641 | ✗ | test = false; | |
| 1642 | ✗ | LOG(Error, "HVACAutoSizing not specified"); | |
| 1643 | } | ||
| 1644 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!runDesignDaysElement) { |
| 1645 | ✗ | test = false; | |
| 1646 | ✗ | LOG(Error, "SimDsgnDays not specified"); | |
| 1647 | } | ||
| 1648 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!beginMonthElement) { |
| 1649 | ✗ | test = false; | |
| 1650 | ✗ | LOG(Error, "RunPeriodBeginMonth not specified"); | |
| 1651 | } | ||
| 1652 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!beginDayElement) { |
| 1653 | ✗ | test = false; | |
| 1654 | ✗ | LOG(Error, "RunPeriodBeginDay not specified"); | |
| 1655 | } | ||
| 1656 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!endMonthElement) { |
| 1657 | ✗ | test = false; | |
| 1658 | ✗ | LOG(Error, "RunPeriodEndMonth not specified"); | |
| 1659 | } | ||
| 1660 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!endDayElement) { |
| 1661 | ✗ | test = false; | |
| 1662 | ✗ | LOG(Error, "RunPeriodEndDay not specified"); | |
| 1663 | } | ||
| 1664 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!yearElement) { |
| 1665 | ✗ | test = false; | |
| 1666 | ✗ | LOG(Error, "RunPeriodYear not specified"); | |
| 1667 | } | ||
| 1668 | |||
| 1669 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!test) { |
| 1670 | ✗ | return boost::none; | |
| 1671 | } | ||
| 1672 | |||
| 1673 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto simulationControl = model.getUniqueModelObject<model::SimulationControl>(); |
| 1674 | |||
| 1675 |
1/1✓ Branch 1 taken 1 time.
|
1 | simulationControl.setMaximumNumberofWarmupDays(50); |
| 1676 | |||
| 1677 |
8/12✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 1 time.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 time.
|
1 | if ((runDesignDaysElement.text().as_int() == 1) || (hvacAutoSizingElement.text().as_int() == 1) || m_masterAutosize) { |
| 1678 | ✗ | simulationControl.setRunSimulationforSizingPeriods(true); | |
| 1679 | } else { | ||
| 1680 |
1/1✓ Branch 1 taken 1 time.
|
1 | simulationControl.setRunSimulationforSizingPeriods(false); |
| 1681 | } | ||
| 1682 | |||
| 1683 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (beginMonthElement.text().as_int(-1) == 0) { |
| 1684 | ✗ | simulationControl.setRunSimulationforWeatherFileRunPeriods(false); | |
| 1685 | |||
| 1686 | // remove any existing run periods | ||
| 1687 | ✗ | boost::optional<model::RunPeriod> runPeriod = model.getOptionalUniqueModelObject<model::RunPeriod>(); | |
| 1688 | ✗ | if (runPeriod) { | |
| 1689 | ✗ | runPeriod->remove(); | |
| 1690 | } | ||
| 1691 | |||
| 1692 | ✗ | } else { | |
| 1693 |
1/1✓ Branch 1 taken 1 time.
|
1 | simulationControl.setRunSimulationforWeatherFileRunPeriods(true); |
| 1694 | |||
| 1695 |
1/1✓ Branch 1 taken 1 time.
|
1 | model::YearDescription yearDescription = model.getUniqueModelObject<model::YearDescription>(); |
| 1696 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | yearDescription.setCalendarYear(yearElement.text().as_int()); |
| 1697 | |||
| 1698 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::string runPeriodName = "Run Period"; |
| 1699 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node annualWeatherFileElement = element.child("AnnualWeatherFile"); |
| 1700 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (annualWeatherFileElement) { |
| 1701 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
2 | runPeriodName = openstudio::toString(openstudio::toPath(annualWeatherFileElement.text().as_string()).stem()); |
| 1702 | } | ||
| 1703 | |||
| 1704 |
1/1✓ Branch 1 taken 1 time.
|
1 | model::RunPeriod runPeriod = model.getUniqueModelObject<model::RunPeriod>(); |
| 1705 |
1/1✓ Branch 1 taken 1 time.
|
1 | runPeriod.setName(runPeriodName); |
| 1706 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | runPeriod.setBeginMonth(beginMonthElement.text().as_int()); |
| 1707 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | runPeriod.setBeginDayOfMonth(beginDayElement.text().as_int()); |
| 1708 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | runPeriod.setEndMonth(endMonthElement.text().as_int()); |
| 1709 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | runPeriod.setEndDayOfMonth(endDayElement.text().as_int()); |
| 1710 |
1/1✓ Branch 1 taken 1 time.
|
1 | runPeriod.setUseWeatherFileHolidays(false); |
| 1711 |
1/1✓ Branch 1 taken 1 time.
|
1 | runPeriod.setUseWeatherFileDaylightSavings(false); |
| 1712 |
1/1✓ Branch 1 taken 1 time.
|
1 | runPeriod.setApplyWeekendHolidayRule(true); |
| 1713 |
1/1✓ Branch 1 taken 1 time.
|
1 | result = runPeriod; |
| 1714 | 1 | } | |
| 1715 | |||
| 1716 | 1 | return result; | |
| 1717 | 1 | } | |
| 1718 | |||
| 1719 | 1 | boost::optional<openstudio::model::ModelObject> ReverseTranslator::translateSite(const pugi::xml_node& element, openstudio::model::Model& model) { | |
| 1720 | //<CliZn>ClimateZone12</CliZn> | ||
| 1721 | //<Lat>38.58</Lat> | ||
| 1722 | //<Long>-121.49</Long> | ||
| 1723 | //<Elevation>839.9</Elevation> | ||
| 1724 | |||
| 1725 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node climateZoneElement = element.child("CliZn"); |
| 1726 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node latElement = element.child("Lat"); |
| 1727 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node longElement = element.child("Long"); |
| 1728 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node elevationElement = element.child("Elevation"); |
| 1729 | |||
| 1730 | 1 | bool test = true; | |
| 1731 | |||
| 1732 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!climateZoneElement) { |
| 1733 | //test = false; | ||
| 1734 | ✗ | LOG(Error, "No climate zone specified"); | |
| 1735 | } | ||
| 1736 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!latElement) { |
| 1737 | ✗ | test = false; | |
| 1738 | ✗ | LOG(Error, "No lattitude specified"); | |
| 1739 | } | ||
| 1740 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!longElement) { |
| 1741 | ✗ | test = false; | |
| 1742 | ✗ | LOG(Error, "No longitude specified"); | |
| 1743 | } | ||
| 1744 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!elevationElement) { |
| 1745 | ✗ | test = false; | |
| 1746 | ✗ | LOG(Error, "No elevation specified"); | |
| 1747 | } | ||
| 1748 | |||
| 1749 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!test) { |
| 1750 | ✗ | return boost::none; | |
| 1751 | } | ||
| 1752 | |||
| 1753 | // set lat, lon, elev | ||
| 1754 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto site = model.getUniqueModelObject<model::Site>(); |
| 1755 | |||
| 1756 | // DLM: what about time zone and terrain? | ||
| 1757 | |||
| 1758 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | double latitude = latElement.text().as_double(); |
| 1759 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | double longitude = longElement.text().as_double(); |
| 1760 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | double elevationIP = elevationElement.text().as_double(); |
| 1761 | 1 | double elevationSI = 0.3048 * elevationIP; | |
| 1762 | |||
| 1763 |
1/1✓ Branch 1 taken 1 time.
|
1 | site.setLatitude(latitude); |
| 1764 |
1/1✓ Branch 1 taken 1 time.
|
1 | site.setLongitude(longitude); |
| 1765 |
1/1✓ Branch 1 taken 1 time.
|
1 | site.setElevation(elevationSI); |
| 1766 | |||
| 1767 | // DLM: always assume California? | ||
| 1768 |
1/1✓ Branch 1 taken 1 time.
|
1 | site.setTimeZone(-8.0); |
| 1769 | |||
| 1770 |
1/1✓ Branch 1 taken 1 time.
|
1 | return site; |
| 1771 | 1 | } | |
| 1772 | |||
| 1773 | 1 | boost::optional<openstudio::model::ModelObject> ReverseTranslator::translateWaterMainsTemperature(const pugi::xml_node& element, | |
| 1774 | openstudio::model::Model& model) { | ||
| 1775 | //<WtrMnTempSchRef>WaterMainCZ12</WtrMnTempSchRef> | ||
| 1776 | |||
| 1777 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node wtrMnTempSchRefElement = element.child("WtrMnTempSchRef"); |
| 1778 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (wtrMnTempSchRefElement) { |
| 1779 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | boost::optional<model::Schedule> schedule = model.getModelObjectByName<model::Schedule>(wtrMnTempSchRefElement.text().as_string()); |
| 1780 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (schedule) { |
| 1781 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto waterMains = model.getUniqueModelObject<model::SiteWaterMainsTemperature>(); |
| 1782 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | waterMains.setTemperatureSchedule(*schedule); |
| 1783 |
1/1✓ Branch 1 taken 1 time.
|
1 | return waterMains; |
| 1784 | 1 | } | |
| 1785 | 1 | } | |
| 1786 | |||
| 1787 | ✗ | return boost::none; | |
| 1788 | } | ||
| 1789 | |||
| 1790 | 1 | std::vector<WorkspaceObject> ReverseTranslator::translateDesignDays(const pugi::xml_node& element, openstudio::model::Model& model) { | |
| 1791 | 1 | std::vector<WorkspaceObject> result; | |
| 1792 | |||
| 1793 | //<DDWeatherFile>F:/360Local/AEC/CBECCn/CBECC Source Files/CBECC-Com13/Data/EPW/SACRAMENTO-EXECUTIVE_724830_CZ2010.ddy</DDWeatherFile> | ||
| 1794 | |||
| 1795 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node ddWeatherFileElement = element.child("DDWeatherFile"); |
| 1796 | |||
| 1797 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!ddWeatherFileElement) { |
| 1798 | ✗ | LOG(Error, "No design day file specified"); | |
| 1799 | ✗ | return result; | |
| 1800 | } | ||
| 1801 | |||
| 1802 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | openstudio::path ddyFilePath = toPath(ddWeatherFileElement.text().as_string()); |
| 1803 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (!ddyFilePath.is_absolute()) { |
| 1804 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | ddyFilePath = openstudio::filesystem::absolute(ddyFilePath, m_path.parent_path()); |
| 1805 | } | ||
| 1806 | |||
| 1807 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (!exists(ddyFilePath)) { |
| 1808 |
8/8✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
|
1 | LOG(Error, "Design day file '" << toString(ddyFilePath) << "' does not exist"); |
| 1809 | 1 | return result; | |
| 1810 | } | ||
| 1811 | |||
| 1812 | ✗ | boost::optional<Workspace> ddyFile = Workspace::load(ddyFilePath); | |
| 1813 | ✗ | if (!ddyFile) { | |
| 1814 | ✗ | LOG(Error, "Could not open design day file '" << toString(ddyFilePath) << "'"); | |
| 1815 | ✗ | return result; | |
| 1816 | } | ||
| 1817 | |||
| 1818 | // convert ddy file to osm and add objects | ||
| 1819 | ✗ | energyplus::ReverseTranslator rt; | |
| 1820 | ✗ | model::Model ddyModel = rt.translateWorkspace(*ddyFile); | |
| 1821 | ✗ | result = model.addObjects(ddyModel.objects()); | |
| 1822 | ✗ | if (result.empty()) { | |
| 1823 | ✗ | LOG(Error, "Failed to add design days to model"); | |
| 1824 | } | ||
| 1825 | |||
| 1826 | ✗ | return result; | |
| 1827 | 1 | } | |
| 1828 | |||
| 1829 | 1 | boost::optional<openstudio::model::ModelObject> ReverseTranslator::translateWeatherFile(const pugi::xml_node& element, | |
| 1830 | openstudio::model::Model& model) { | ||
| 1831 | //<AnnualWeatherFile>F:/360Local/AEC/CBECCn/CBECC Source Files/CBECC-Com13/Data/EPW/SACRAMENTO-EXECUTIVE_724830_CZ2010.epw</AnnualWeatherFile> | ||
| 1832 | |||
| 1833 |
1/1✓ Branch 1 taken 1 time.
|
1 | pugi::xml_node annualWeatherFileElement = element.child("AnnualWeatherFile"); |
| 1834 | |||
| 1835 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!annualWeatherFileElement) { |
| 1836 | ✗ | LOG(Error, "No annual weather file specified"); | |
| 1837 | ✗ | return boost::none; | |
| 1838 | } | ||
| 1839 | |||
| 1840 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | openstudio::path epwFilePath = toPath(annualWeatherFileElement.text().as_string()); |
| 1841 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (!epwFilePath.is_absolute()) { |
| 1842 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | epwFilePath = openstudio::filesystem::absolute(epwFilePath, m_path.parent_path()); |
| 1843 | } | ||
| 1844 | |||
| 1845 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (!exists(epwFilePath)) { |
| 1846 |
8/8✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
|
1 | LOG(Error, "Annual weather file '" << toString(epwFilePath) << "' does not exist"); |
| 1847 | 1 | return boost::none; | |
| 1848 | } | ||
| 1849 | |||
| 1850 | ✗ | boost::optional<EpwFile> epwFile; | |
| 1851 | try { | ||
| 1852 | ✗ | epwFile = EpwFile(epwFilePath); | |
| 1853 | ✗ | } catch (std::exception&) { | |
| 1854 | ✗ | LOG(Error, "Could not open epw file '" << toString(epwFilePath) << "'"); | |
| 1855 | ✗ | } | |
| 1856 | |||
| 1857 | ✗ | if (!epwFile) { | |
| 1858 | ✗ | return boost::none; | |
| 1859 | } | ||
| 1860 | |||
| 1861 | // set weatherfile | ||
| 1862 | ✗ | boost::optional<model::WeatherFile> weatherFile = model::WeatherFile::setWeatherFile(model, *epwFile); | |
| 1863 | ✗ | if (!weatherFile) { | |
| 1864 | ✗ | LOG(Error, "Failed to set weather file for model"); | |
| 1865 | ✗ | return boost::none; | |
| 1866 | } | ||
| 1867 | |||
| 1868 | ✗ | return weatherFile.get(); | |
| 1869 | 1 | } | |
| 1870 | |||
| 1871 | 60 | pugi::xml_node ReverseTranslator::supplySegment(const pugi::xml_node& fluidSegInRefElement) { | |
| 1872 | |||
| 1873 |
1/1✓ Branch 1 taken 60 times.
|
60 | pugi::xml_node projectElement = getProjectElement(fluidSegInRefElement); |
| 1874 |
3/3✓ Branch 1 taken 60 times.
✓ Branch 4 taken 60 times.
✓ Branch 7 taken 60 times.
|
60 | std::string fluidSegmentName = fluidSegInRefElement.text().as_string(); |
| 1875 | |||
| 1876 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 60 times.
|
60 | if (fluidSegmentName.empty()) { |
| 1877 | ✗ | LOG(Error, "supplySegment called with an empty fluidSegmentName"); | |
| 1878 | ✗ | OS_ASSERT(false); | |
| 1879 | } | ||
| 1880 | |||
| 1881 |
5/6✓ Branch 1 taken 60 times.
✓ Branch 6 taken 178 times.
✓ Branch 9 taken 118 times.
✓ Branch 12 taken 178 times.
✓ Branch 14 taken 178 times.
✗ Branch 15 not taken.
|
178 | for (auto& fluidSysElement : projectElement.children("FluidSys")) { |
| 1882 |
6/6✓ Branch 1 taken 178 times.
✓ Branch 6 taken 296 times.
✓ Branch 9 taken 236 times.
✓ Branch 12 taken 414 times.
✓ Branch 14 taken 296 times.
✓ Branch 15 taken 118 times.
|
414 | for (auto& fluidSegmentElement : fluidSysElement.children("FluidSeg")) { |
| 1883 |
1/1✓ Branch 1 taken 296 times.
|
296 | auto nameElement = fluidSegmentElement.child("Name"); |
| 1884 |
1/1✓ Branch 1 taken 296 times.
|
296 | auto typeElement = fluidSegmentElement.child("Type"); |
| 1885 | |||
| 1886 |
20/43✓ Branch 1 taken 296 times.
✓ Branch 4 taken 296 times.
✓ Branch 7 taken 296 times.
✓ Branch 10 taken 296 times.
✓ Branch 13 taken 296 times.
✓ Branch 16 taken 296 times.
✓ Branch 19 taken 296 times.
✓ Branch 22 taken 296 times.
✓ Branch 25 taken 296 times.
✓ Branch 27 taken 178 times.
✓ Branch 28 taken 118 times.
✓ Branch 30 taken 296 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 296 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 296 times.
✗ Branch 36 not taken.
✓ Branch 37 taken 296 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 296 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 296 times.
✗ Branch 43 not taken.
✓ Branch 45 taken 296 times.
✗ Branch 46 not taken.
✓ Branch 47 taken 60 times.
✓ Branch 48 taken 236 times.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
|
2664 | if ((istringEqual(typeElement.text().as_string(), "SECONDARYSUPPLY") || istringEqual(typeElement.text().as_string(), "PRIMARYSUPPLY")) |
| 1887 |
13/19✓ Branch 1 taken 296 times.
✓ Branch 3 taken 296 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 178 times.
✓ Branch 9 taken 178 times.
✓ Branch 12 taken 178 times.
✓ Branch 15 taken 178 times.
✓ Branch 17 taken 60 times.
✓ Branch 18 taken 118 times.
✓ Branch 19 taken 178 times.
✓ Branch 20 taken 118 times.
✓ Branch 22 taken 178 times.
✓ Branch 23 taken 118 times.
✓ Branch 24 taken 296 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
|
1362 | && istringEqual(nameElement.text().as_string(), fluidSegmentName)) { |
| 1888 | 60 | return fluidSegmentElement; | |
| 1889 | } | ||
| 1890 | } | ||
| 1891 | } | ||
| 1892 | |||
| 1893 | ✗ | return {}; | |
| 1894 | 60 | } | |
| 1895 | |||
| 1896 | 34 | boost::optional<model::PlantLoop> ReverseTranslator::loopForSupplySegment(const pugi::xml_node& fluidSegInRefElement, | |
| 1897 | openstudio::model::Model& model) { | ||
| 1898 |
1/1✓ Branch 1 taken 34 times.
|
34 | auto fluidSegmentElement = supplySegment(fluidSegInRefElement); |
| 1899 |
1/1✓ Branch 1 taken 34 times.
|
34 | auto fluidSysElement = fluidSegmentElement.parent(); |
| 1900 |
1/1✓ Branch 1 taken 34 times.
|
34 | auto fluidSysNameElement = fluidSysElement.child("Name"); |
| 1901 | |||
| 1902 |
4/4✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
✓ Branch 7 taken 34 times.
✓ Branch 10 taken 34 times.
|
34 | return model.getConcreteModelObjectByName<model::PlantLoop>(fluidSysNameElement.text().as_string()); |
| 1903 | } | ||
| 1904 | |||
| 1905 | 21 | boost::optional<model::PlantLoop> ReverseTranslator::serviceHotWaterLoopForSupplySegment(const pugi::xml_node& fluidSegInRefElement, | |
| 1906 | openstudio::model::Model& model) { | ||
| 1907 | |||
| 1908 |
1/1✓ Branch 1 taken 21 times.
|
21 | pugi::xml_node projectElement = getProjectElement(fluidSegInRefElement); |
| 1909 |
3/3✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
|
21 | std::string fluidSegmentName = fluidSegInRefElement.text().as_string(); |
| 1910 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 21 times.
|
21 | if (fluidSegmentName.empty()) { |
| 1911 | ✗ | LOG(Error, "supplySegment called with an empty fluidSegmentName"); | |
| 1912 | ✗ | OS_ASSERT(false); | |
| 1913 | } | ||
| 1914 | |||
| 1915 | 21 | boost::optional<model::PlantLoop> result; | |
| 1916 | |||
| 1917 |
4/6✓ Branch 1 taken 21 times.
✓ Branch 6 taken 21 times.
✗ Branch 9 not taken.
✓ Branch 12 taken 21 times.
✓ Branch 14 taken 21 times.
✗ Branch 15 not taken.
|
21 | for (auto& fluidSysElement : projectElement.children("FluidSys")) { |
| 1918 | |||
| 1919 |
1/1✓ Branch 1 taken 21 times.
|
21 | auto fluidSysNameElement = fluidSysElement.child("Name"); |
| 1920 | |||
| 1921 |
1/1✓ Branch 1 taken 21 times.
|
21 | auto fluidSysTypeElement = fluidSysElement.child("Type"); |
| 1922 | |||
| 1923 |
6/7✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 13 taken 21 times.
✓ Branch 17 taken 21 times.
✗ Branch 18 not taken.
|
63 | if (openstudio::istringEqual(fluidSysTypeElement.text().as_string(), "SERVICEHOTWATER")) { |
| 1924 |
4/6✓ Branch 1 taken 21 times.
✓ Branch 6 taken 21 times.
✗ Branch 9 not taken.
✓ Branch 12 taken 21 times.
✓ Branch 14 taken 21 times.
✗ Branch 15 not taken.
|
21 | for (auto& fluidSegmentElement : fluidSysElement.children("FluidSeg")) { |
| 1925 | |||
| 1926 |
1/1✓ Branch 1 taken 21 times.
|
21 | auto nameElement = fluidSegmentElement.child("Name"); |
| 1927 |
1/1✓ Branch 1 taken 21 times.
|
21 | auto typeElement = fluidSegmentElement.child("Type"); |
| 1928 | |||
| 1929 |
8/20✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 13 taken 21 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 21 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 21 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 21 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
|
105 | if ((openstudio::istringEqual(typeElement.text().as_string(), "SECONDARYSUPPLY") |
| 1930 |
10/23✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 13 taken 21 times.
✓ Branch 15 taken 21 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 21 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 21 times.
✗ Branch 21 not taken.
✓ Branch 23 taken 21 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 21 times.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
|
105 | || openstudio::istringEqual(typeElement.text().as_string(), "PRIMARYSUPPLY")) |
| 1931 |
10/19✓ Branch 1 taken 21 times.
✓ Branch 3 taken 21 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 21 times.
✓ Branch 9 taken 21 times.
✓ Branch 12 taken 21 times.
✓ Branch 15 taken 21 times.
✓ Branch 17 taken 21 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 21 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 21 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 21 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
|
105 | && openstudio::istringEqual(nameElement.text().as_string(), fluidSegmentName)) { |
| 1932 | 21 | if (boost::optional<model::PlantLoop> loop = | |
| 1933 |
6/6✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 14 taken 20 times.
✓ Branch 15 taken 1 time.
|
42 | model.getConcreteModelObjectByName<model::PlantLoop>(fluidSysNameElement.text().as_string())) { |
| 1934 | 20 | return loop; | |
| 1935 | } else { | ||
| 1936 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<model::ModelObject> mo = translateFluidSys(fluidSysElement, model)) { |
| 1937 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return mo->optionalCast<model::PlantLoop>(); |
| 1938 | 1 | } | |
| 1939 | 21 | } | |
| 1940 | } | ||
| 1941 | } | ||
| 1942 | } | ||
| 1943 | } | ||
| 1944 | |||
| 1945 | ✗ | return result; | |
| 1946 | 21 | } | |
| 1947 | |||
| 1948 | //TODO probably should be in OS proper | ||
| 1949 | //helper method to do unit conversions; | ||
| 1950 | 225 | boost::optional<double> ReverseTranslator::unitToUnit(double val, const std::string& fstUnitString, const std::string& secUnitString) { | |
| 1951 | //create the units from the strings | ||
| 1952 |
3/3✓ Branch 1 taken 225 times.
✓ Branch 4 taken 225 times.
✓ Branch 7 taken 225 times.
|
225 | boost::optional<Unit> fstUnit = UnitFactory::instance().createUnit(fstUnitString); |
| 1953 |
3/3✓ Branch 1 taken 225 times.
✓ Branch 4 taken 225 times.
✓ Branch 7 taken 225 times.
|
225 | boost::optional<Unit> secUnit = UnitFactory::instance().createUnit(secUnitString); |
| 1954 | |||
| 1955 | //make sure both unit strings were valid | ||
| 1956 |
3/6✓ Branch 0 taken 225 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 225 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 225 times.
✗ Branch 5 not taken.
|
450 | if (fstUnit && secUnit) { |
| 1957 | |||
| 1958 | //make the IP quantity | ||
| 1959 |
2/2✓ Branch 1 taken 225 times.
✓ Branch 4 taken 225 times.
|
225 | Quantity ipQuant = Quantity(val, *fstUnit); |
| 1960 | |||
| 1961 | //convert the IP quantity from IP to SI | ||
| 1962 |
3/3✓ Branch 1 taken 225 times.
✓ Branch 4 taken 225 times.
✓ Branch 7 taken 225 times.
|
225 | boost::optional<Quantity> siQuant = QuantityConverter::instance().convert(ipQuant, *secUnit); |
| 1963 | |||
| 1964 | //if the conversion | ||
| 1965 |
1/2✓ Branch 0 taken 225 times.
✗ Branch 1 not taken.
|
225 | if (siQuant) { |
| 1966 |
3/3✓ Branch 1 taken 225 times.
✓ Branch 4 taken 225 times.
✓ Branch 7 taken 225 times.
|
225 | return siQuant->value(); |
| 1967 | } | ||
| 1968 | 450 | } | |
| 1969 | |||
| 1970 | ✗ | return boost::none; | |
| 1971 | 225 | } | |
| 1972 | |||
| 1973 | 116 | bool ReverseTranslator::autosize() const { | |
| 1974 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 116 times.
|
116 | if (m_masterAutosize) { |
| 1975 | ✗ | return true; | |
| 1976 | } | ||
| 1977 | |||
| 1978 | 116 | return m_autosize; | |
| 1979 | } | ||
| 1980 | |||
| 1981 | } // namespace sdd | ||
| 1982 | } // namespace openstudio | ||
| 1983 |