src/energyplus/ForwardTranslator/ForwardTranslatePlantLoop.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 "../ForwardTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/Model.hpp" | ||
| 9 | #include "../../model/PlantLoop.hpp" | ||
| 10 | #include "../../model/PlantLoop_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../model/AvailabilityManagerAssignmentList.hpp" | ||
| 13 | #include "../../model/AvailabilityManagerAssignmentList_Impl.hpp" | ||
| 14 | #include "../../model/AvailabilityManager.hpp" | ||
| 15 | #include "../../model/AvailabilityManager_Impl.hpp" | ||
| 16 | #include "../../model/AirLoopHVACOutdoorAirSystem.hpp" | ||
| 17 | #include "../../model/AirLoopHVACOutdoorAirSystem_Impl.hpp" | ||
| 18 | #include "../../model/SizingPlant.hpp" | ||
| 19 | #include "../../model/SizingPlant_Impl.hpp" | ||
| 20 | #include "../../model/Node.hpp" | ||
| 21 | #include "../../model/Node_Impl.hpp" | ||
| 22 | #include "../../model/Splitter.hpp" | ||
| 23 | #include "../../model/Splitter_Impl.hpp" | ||
| 24 | #include "../../model/Mixer.hpp" | ||
| 25 | #include "../../model/Mixer_Impl.hpp" | ||
| 26 | #include "../../model/PumpVariableSpeed.hpp" | ||
| 27 | #include "../../model/Schedule.hpp" | ||
| 28 | #include "../../model/Schedule_Impl.hpp" | ||
| 29 | #include "../../model/BoilerHotWater.hpp" | ||
| 30 | #include "../../model/BoilerHotWater_Impl.hpp" | ||
| 31 | #include "../../model/CentralHeatPumpSystem.hpp" | ||
| 32 | #include "../../model/CentralHeatPumpSystem_Impl.hpp" | ||
| 33 | #include "../../model/ChillerElectricASHRAE205.hpp" | ||
| 34 | #include "../../model/ChillerElectricASHRAE205_Impl.hpp" | ||
| 35 | #include "../../model/ChillerElectricEIR.hpp" | ||
| 36 | #include "../../model/ChillerElectricEIR_Impl.hpp" | ||
| 37 | #include "../../model/ChillerElectricReformulatedEIR.hpp" | ||
| 38 | #include "../../model/ChillerElectricReformulatedEIR_Impl.hpp" | ||
| 39 | #include "../../model/ChillerAbsorption.hpp" | ||
| 40 | #include "../../model/ChillerAbsorption_Impl.hpp" | ||
| 41 | #include "../../model/ChillerAbsorptionIndirect.hpp" | ||
| 42 | #include "../../model/ChillerAbsorptionIndirect_Impl.hpp" | ||
| 43 | #include "../../model/WaterHeaterMixed.hpp" | ||
| 44 | #include "../../model/WaterHeaterMixed_Impl.hpp" | ||
| 45 | #include "../../model/WaterHeaterHeatPump.hpp" | ||
| 46 | #include "../../model/WaterHeaterHeatPump_Impl.hpp" | ||
| 47 | #include "../../model/WaterHeaterStratified.hpp" | ||
| 48 | #include "../../model/WaterHeaterStratified_Impl.hpp" | ||
| 49 | #include "../../model/CoolingTowerVariableSpeed.hpp" | ||
| 50 | #include "../../model/CoolingTowerVariableSpeed_Impl.hpp" | ||
| 51 | #include "../../model/CoolingTowerSingleSpeed.hpp" | ||
| 52 | #include "../../model/CoolingTowerSingleSpeed_Impl.hpp" | ||
| 53 | #include "../../model/CoolingTowerTwoSpeed.hpp" | ||
| 54 | #include "../../model/CoolingTowerTwoSpeed_Impl.hpp" | ||
| 55 | #include "../../model/GeneratorMicroTurbine.hpp" | ||
| 56 | #include "../../model/GeneratorMicroTurbine_Impl.hpp" | ||
| 57 | #include "../../model/GeneratorMicroTurbineHeatRecovery.hpp" | ||
| 58 | #include "../../model/GeneratorMicroTurbineHeatRecovery_Impl.hpp" | ||
| 59 | #include "../../model/GroundHeatExchangerVertical.hpp" | ||
| 60 | #include "../../model/GroundHeatExchangerVertical_Impl.hpp" | ||
| 61 | #include "../../model/GroundHeatExchangerHorizontalTrench.hpp" | ||
| 62 | #include "../../model/GroundHeatExchangerHorizontalTrench_Impl.hpp" | ||
| 63 | #include "../../model/HeatExchangerFluidToFluid.hpp" | ||
| 64 | #include "../../model/HeatExchangerFluidToFluid_Impl.hpp" | ||
| 65 | #include "../../model/HeatPumpAirToWaterCooling.hpp" | ||
| 66 | #include "../../model/HeatPumpAirToWaterCooling_Impl.hpp" | ||
| 67 | #include "../../model/HeatPumpAirToWaterHeating.hpp" | ||
| 68 | #include "../../model/HeatPumpAirToWaterHeating_Impl.hpp" | ||
| 69 | #include "../../model/WaterToAirComponent.hpp" | ||
| 70 | #include "../../model/WaterToAirComponent_Impl.hpp" | ||
| 71 | #include "../../model/WaterToWaterComponent.hpp" | ||
| 72 | #include "../../model/WaterToWaterComponent_Impl.hpp" | ||
| 73 | #include "../../model/CoilHeatingWaterBaseboard.hpp" | ||
| 74 | #include "../../model/CoilHeatingWaterBaseboard_Impl.hpp" | ||
| 75 | #include "../../model/CoilHeatingWaterBaseboardRadiant.hpp" | ||
| 76 | #include "../../model/CoilHeatingWaterBaseboardRadiant_Impl.hpp" | ||
| 77 | #include "../../model/CoilCoolingWaterPanelRadiant.hpp" | ||
| 78 | #include "../../model/CoilCoolingWaterPanelRadiant_Impl.hpp" | ||
| 79 | #include "../../model/CoilCoolingCooledBeam.hpp" | ||
| 80 | #include "../../model/CoilCoolingCooledBeam_Impl.hpp" | ||
| 81 | #include "../../model/CoilCoolingFourPipeBeam.hpp" | ||
| 82 | #include "../../model/CoilCoolingFourPipeBeam_Impl.hpp" | ||
| 83 | #include "../../model/CoilHeatingFourPipeBeam.hpp" | ||
| 84 | #include "../../model/CoilHeatingFourPipeBeam_Impl.hpp" | ||
| 85 | #include "../../model/StraightComponent.hpp" | ||
| 86 | #include "../../model/StraightComponent_Impl.hpp" | ||
| 87 | #include "../../model/CoilHeatingLowTempRadiantConstFlow.hpp" | ||
| 88 | #include "../../model/CoilHeatingLowTempRadiantConstFlow_Impl.hpp" | ||
| 89 | #include "../../model/CoilCoolingLowTempRadiantConstFlow.hpp" | ||
| 90 | #include "../../model/CoilCoolingLowTempRadiantConstFlow_Impl.hpp" | ||
| 91 | #include "../../model/CoilHeatingLowTempRadiantVarFlow.hpp" | ||
| 92 | #include "../../model/CoilHeatingLowTempRadiantVarFlow_Impl.hpp" | ||
| 93 | #include "../../model/CoilCoolingLowTempRadiantVarFlow.hpp" | ||
| 94 | #include "../../model/CoilCoolingLowTempRadiantVarFlow_Impl.hpp" | ||
| 95 | #include "../../model/ZoneHVACComponent.hpp" | ||
| 96 | #include "../../model/ZoneHVACComponent_Impl.hpp" | ||
| 97 | #include "../../model/SetpointManager.hpp" | ||
| 98 | #include "../../model/SetpointManagerScheduledDualSetpoint.hpp" | ||
| 99 | #include "../../model/SetpointManagerScheduledDualSetpoint_Impl.hpp" | ||
| 100 | #include "../../model/LifeCycleCost.hpp" | ||
| 101 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 102 | #include <utilities/idd/IddEnums.hxx> | ||
| 103 | #include <utilities/idd/IddFactory.hxx> | ||
| 104 | #include <utilities/idd/PlantLoop_FieldEnums.hxx> | ||
| 105 | #include <utilities/idd/BranchList_FieldEnums.hxx> | ||
| 106 | #include <utilities/idd/Branch_FieldEnums.hxx> | ||
| 107 | #include <utilities/idd/ConnectorList_FieldEnums.hxx> | ||
| 108 | #include <utilities/idd/Connector_Splitter_FieldEnums.hxx> | ||
| 109 | #include <utilities/idd/Connector_Mixer_FieldEnums.hxx> | ||
| 110 | #include <utilities/idd/Pipe_Adiabatic_FieldEnums.hxx> | ||
| 111 | #include <utilities/idd/PlantEquipmentOperationSchemes_FieldEnums.hxx> | ||
| 112 | #include <utilities/idd/PlantEquipmentOperation_HeatingLoad_FieldEnums.hxx> | ||
| 113 | #include <utilities/idd/PlantEquipmentOperation_CoolingLoad_FieldEnums.hxx> | ||
| 114 | #include <utilities/idd/PlantEquipmentOperation_ComponentSetpoint_FieldEnums.hxx> | ||
| 115 | #include <utilities/idd/PlantEquipmentOperation_Uncontrolled_FieldEnums.hxx> | ||
| 116 | #include <utilities/idd/PlantEquipmentList_FieldEnums.hxx> | ||
| 117 | #include <utilities/idd/Sizing_Plant_FieldEnums.hxx> | ||
| 118 | #include <utilities/idd/AirTerminal_SingleDuct_ConstantVolume_CooledBeam_FieldEnums.hxx> | ||
| 119 | #include <utilities/idd/AirTerminal_SingleDuct_ConstantVolume_FourPipeBeam_FieldEnums.hxx> | ||
| 120 | #include <utilities/idd/ZoneHVAC_AirDistributionUnit_FieldEnums.hxx> | ||
| 121 | #include <utilities/idd/FluidProperties_Name_FieldEnums.hxx> | ||
| 122 | #include <utilities/idd/AvailabilityManagerAssignmentList_FieldEnums.hxx> | ||
| 123 | #include "../../utilities/core/Assert.hpp" | ||
| 124 | |||
| 125 | using namespace openstudio::model; | ||
| 126 | |||
| 127 | using namespace std; | ||
| 128 | |||
| 129 | namespace openstudio { | ||
| 130 | |||
| 131 | namespace energyplus { | ||
| 132 | |||
| 133 | 416 | IdfObject ForwardTranslator::populateBranch(IdfObject& branchIdfObject, std::vector<ModelObject>& modelObjects, Loop& loop, bool isSupplyBranch) { | |
| 134 |
1/2✓ Branch 1 taken 416 times.
✗ Branch 2 not taken.
|
416 | if (!modelObjects.empty()) { |
| 135 | 416 | [[maybe_unused]] int i = 0; | |
| 136 | |||
| 137 | 416 | boost::optional<Node> prevNode_; | |
| 138 | |||
| 139 |
2/2✓ Branch 5 taken 1476 times.
✓ Branch 6 taken 416 times.
|
1892 | for (auto& modelObject : modelObjects) { |
| 140 | 1476 | boost::optional<Node> inletNode; | |
| 141 | 1476 | boost::optional<Node> outletNode; | |
| 142 | 1476 | std::string objectName; | |
| 143 | 1476 | std::string iddType; | |
| 144 | |||
| 145 | //translate and map each model object | ||
| 146 | //in most cases, the name and idd object type come directly from the resulting idfObject | ||
| 147 |
3/3✓ Branch 1 taken 1476 times.
✓ Branch 3 taken 473 times.
✓ Branch 4 taken 1003 times.
|
2952 | if (boost::optional<IdfObject> idfObject = this->translateAndMapModelObject(modelObject)) { |
| 148 |
4/4✓ Branch 1 taken 473 times.
✓ Branch 4 taken 473 times.
✓ Branch 7 taken 473 times.
✓ Branch 10 taken 473 times.
|
473 | objectName = idfObject->name().get(); |
| 149 |
3/3✓ Branch 1 taken 473 times.
✓ Branch 4 taken 473 times.
✓ Branch 7 taken 473 times.
|
473 | iddType = idfObject->iddObject().name(); |
| 150 | 1476 | } | |
| 151 | |||
| 152 |
3/3✓ Branch 1 taken 1476 times.
✓ Branch 4 taken 941 times.
✓ Branch 5 taken 535 times.
|
2952 | if (modelObject.optionalCast<Node>()) { |
| 153 | // Skip nodes we don't want them showing up on branches | ||
| 154 |
2/2✓ Branch 1 taken 941 times.
✓ Branch 4 taken 941 times.
|
941 | prevNode_ = modelObject.cast<Node>(); |
| 155 | 941 | continue; | |
| 156 | } | ||
| 157 | |||
| 158 |
3/3✓ Branch 1 taken 535 times.
✓ Branch 3 taken 247 times.
✓ Branch 4 taken 288 times.
|
1070 | if (auto straightComponent = modelObject.optionalCast<StraightComponent>()) { |
| 159 |
4/4✓ Branch 1 taken 247 times.
✓ Branch 4 taken 247 times.
✓ Branch 7 taken 247 times.
✓ Branch 10 taken 247 times.
|
247 | inletNode = straightComponent->inletModelObject()->optionalCast<Node>(); |
| 160 |
4/4✓ Branch 1 taken 247 times.
✓ Branch 4 taken 247 times.
✓ Branch 7 taken 247 times.
✓ Branch 10 taken 247 times.
|
247 | outletNode = straightComponent->outletModelObject()->optionalCast<Node>(); |
| 161 | //special case for ZoneHVAC:Baseboard:Convective:Water. In E+, this object appears on both the | ||
| 162 | //zonehvac:equipmentlist and the branch. In OpenStudio, this object was broken into 2 objects: | ||
| 163 | //ZoneHVACBaseboardConvectiveWater and CoilHeatingWaterBaseboard. The ZoneHVAC goes onto the zone and | ||
| 164 | //has a child coil that goes onto the plantloop. In order to get the correct translation to E+, we need | ||
| 165 | //to put the name of the containing ZoneHVACBaseboardConvectiveWater onto the branch. | ||
| 166 |
2/3✓ Branch 1 taken 247 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 247 times.
|
494 | if (boost::optional<CoilHeatingWaterBaseboard> coilBB = modelObject.optionalCast<CoilHeatingWaterBaseboard>()) { |
| 167 | ✗ | if (boost::optional<ZoneHVACComponent> contZnBB = coilBB->containingZoneHVACComponent()) { | |
| 168 | //translate and map containingZoneHVACBBConvWater | ||
| 169 | ✗ | if (boost::optional<IdfObject> idfContZnBB = this->translateAndMapModelObject(*contZnBB)) { | |
| 170 | //Get the name and the idd object from the idf object version of this | ||
| 171 | ✗ | objectName = idfContZnBB->name().get(); | |
| 172 | ✗ | iddType = idfContZnBB->iddObject().name(); | |
| 173 | ✗ | } | |
| 174 | ✗ | } | |
| 175 | 247 | } | |
| 176 | //special case for ZoneHVAC:Baseboard:RadiantConvective:Water. In E+, this object appears on both the | ||
| 177 | //zonehvac:equipmentlist and the branch. In OpenStudio, this object was broken into 2 objects: | ||
| 178 | //ZoneHVACBaseboardRadiantConvectiveWater and CoilHeatingWaterBaseboardRadiant. The ZoneHVAC goes onto the zone and | ||
| 179 | //has a child coil that goes onto the plantloop. In order to get the correct translation to E+, we need | ||
| 180 | //to put the name of the containing ZoneHVACBaseboardRadiantConvectiveWater onto the branch. | ||
| 181 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 246 times.
|
494 | if (auto coilBBRad = modelObject.optionalCast<CoilHeatingWaterBaseboardRadiant>()) { |
| 182 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (auto contZnBBRad = coilBBRad->containingZoneHVACComponent()) { |
| 183 | //translate and map containingZoneHVACBBRadConvWater | ||
| 184 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (auto idfContZnBBRad = this->translateAndMapModelObject(*contZnBBRad)) { |
| 185 | //Get the name and the idd object from the idf object version of this | ||
| 186 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | objectName = idfContZnBBRad->name().get(); |
| 187 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | iddType = idfContZnBBRad->iddObject().name(); |
| 188 | 1 | } | |
| 189 | 1 | } | |
| 190 | 247 | } | |
| 191 | //special case for ZoneHVAC:CoolingPanel:RadiantConvective:Water. In E+, this object appears on both the | ||
| 192 | //zonehvac:equipmentlist and the branch. In OpenStudio, this object was broken into 2 objects: | ||
| 193 | //ZoneHVACCoolingPanelRadiantConvectiveWater and CoilCoolingWaterPanelRadiant. The ZoneHVAC goes onto the zone and | ||
| 194 | //has a child coil that goes onto the plantloop. In order to get the correct translation to E+, we need | ||
| 195 | //to put the name of the containing ZoneHVACCoolingPanelRadiantConvectiveWater onto the branch. | ||
| 196 |
2/3✓ Branch 1 taken 247 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 247 times.
|
494 | if (auto coilCPRad = modelObject.optionalCast<CoilCoolingWaterPanelRadiant>()) { |
| 197 | ✗ | if (auto contZnCPRad = coilCPRad->containingZoneHVACComponent()) { | |
| 198 | //translate and map containingZoneHVACBBRadConvWater | ||
| 199 | ✗ | if (auto idfContZnCPRad = this->translateAndMapModelObject(*contZnCPRad)) { | |
| 200 | //Get the name and the idd object from the idf object version of this | ||
| 201 | ✗ | objectName = idfContZnCPRad->name().get(); | |
| 202 | ✗ | iddType = idfContZnCPRad->iddObject().name(); | |
| 203 | ✗ | } | |
| 204 | ✗ | } | |
| 205 | 247 | } | |
| 206 | //special case for AirTerminalSingleDuctConstantVolumeChilledBeam | ||
| 207 |
2/3✓ Branch 1 taken 247 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 247 times.
|
494 | if (boost::optional<CoilCoolingCooledBeam> coilCB = modelObject.optionalCast<CoilCoolingCooledBeam>()) { |
| 208 | ✗ | if (boost::optional<StraightComponent> airTerm = coilCB->containingStraightComponent()) { | |
| 209 | ✗ | boost::optional<IdfObject> idfAirDistUnit = this->translateAndMapModelObject(*airTerm); | |
| 210 | //translate and map containingStraightComponent | ||
| 211 | ✗ | if (idfAirDistUnit) { | |
| 212 | //Get the name and idd type of the air terminal inside the air distribution unit | ||
| 213 | ✗ | objectName = idfAirDistUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalName).get(); | |
| 214 | ✗ | iddType = idfAirDistUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalObjectType).get(); | |
| 215 | } | ||
| 216 | ✗ | } | |
| 217 | 247 | } | |
| 218 | |||
| 219 | //special case for AirTerminalSingleDuctConstantVolumeFourPipeBeam: Cooling Side | ||
| 220 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 246 times.
|
494 | if (boost::optional<CoilCoolingFourPipeBeam> coilFPB = modelObject.optionalCast<CoilCoolingFourPipeBeam>()) { |
| 221 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<StraightComponent> airTerm = coilFPB->containingStraightComponent()) { |
| 222 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> idfAirDistUnit = this->translateAndMapModelObject(*airTerm); |
| 223 | //translate and map containingStraightComponent | ||
| 224 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (idfAirDistUnit) { |
| 225 | //Get the name and idd type of the air terminal inside the air distribution unit | ||
| 226 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | objectName = idfAirDistUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalName).get(); |
| 227 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | iddType = idfAirDistUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalObjectType).get(); |
| 228 | } | ||
| 229 | 2 | } | |
| 230 | 247 | } | |
| 231 | //special case for AirTerminalSingleDuctConstantVolumeFourPipeBeam: Cooling Side | ||
| 232 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 246 times.
|
494 | if (boost::optional<CoilHeatingFourPipeBeam> coilFPB = modelObject.optionalCast<CoilHeatingFourPipeBeam>()) { |
| 233 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<StraightComponent> airTerm = coilFPB->containingStraightComponent()) { |
| 234 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> idfAirDistUnit = this->translateAndMapModelObject(*airTerm); |
| 235 | //translate and map containingStraightComponent | ||
| 236 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (idfAirDistUnit) { |
| 237 | //Get the name and idd type of the air terminal inside the air distribution unit | ||
| 238 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | objectName = idfAirDistUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalName).get(); |
| 239 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | iddType = idfAirDistUnit->getString(ZoneHVAC_AirDistributionUnitFields::AirTerminalObjectType).get(); |
| 240 | } | ||
| 241 | 2 | } | |
| 242 | 247 | } | |
| 243 | //special case for ZoneHVAC:LowTemperatureRadiant:ConstantFlow and ZoneHVAC:LowTemperatureRadiant:VariableFlow. In E+, this object appears on both the | ||
| 244 | //zonehvac:equipmentlist and the branch. In OpenStudio, this object was broken into 2 objects: | ||
| 245 | //ZoneHVACBaseboardConvectiveWater and CoilHeatingWaterBaseboard. The ZoneHVAC goes onto the zone and | ||
| 246 | //has a child coil that goes onto the plantloop. In order to get the correct translation to E+, we need | ||
| 247 | //to put the name of the containing ZoneHVACBaseboardConvectiveWater onto the branch. | ||
| 248 |
2/3✓ Branch 1 taken 247 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 247 times.
|
494 | if (boost::optional<CoilHeatingLowTempRadiantConstFlow> coilHLRC = modelObject.optionalCast<CoilHeatingLowTempRadiantConstFlow>()) { |
| 249 | ✗ | if (boost::optional<ZoneHVACComponent> znLowTempRadConst = coilHLRC->containingZoneHVACComponent()) { | |
| 250 | //translate and map containingZoneHVACBBConvWater | ||
| 251 | ✗ | if (boost::optional<IdfObject> idfZnLowTempRadConst = this->translateAndMapModelObject(*znLowTempRadConst)) { | |
| 252 | //Get the name and the idd object from the idf object version of this | ||
| 253 | ✗ | objectName = idfZnLowTempRadConst->name().get(); | |
| 254 | ✗ | iddType = idfZnLowTempRadConst->iddObject().name(); | |
| 255 | ✗ | } | |
| 256 | ✗ | } | |
| 257 | 247 | } | |
| 258 |
2/3✓ Branch 1 taken 247 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 247 times.
|
494 | if (boost::optional<CoilCoolingLowTempRadiantConstFlow> coilCLRC = modelObject.optionalCast<CoilCoolingLowTempRadiantConstFlow>()) { |
| 259 | ✗ | if (boost::optional<ZoneHVACComponent> znLowTempRadConst = coilCLRC->containingZoneHVACComponent()) { | |
| 260 | //translate and map containingZoneHVACBBConvWater | ||
| 261 | ✗ | if (boost::optional<IdfObject> idfZnLowTempRadConst = this->translateAndMapModelObject(*znLowTempRadConst)) { | |
| 262 | //Get the name and the idd object from the idf object version of this | ||
| 263 | ✗ | objectName = idfZnLowTempRadConst->name().get(); | |
| 264 | ✗ | iddType = idfZnLowTempRadConst->iddObject().name(); | |
| 265 | ✗ | } | |
| 266 | ✗ | } | |
| 267 | 247 | } | |
| 268 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 241 times.
|
494 | if (boost::optional<CoilHeatingLowTempRadiantVarFlow> coilHLRC = modelObject.optionalCast<CoilHeatingLowTempRadiantVarFlow>()) { |
| 269 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 6 taken 4 times.
✓ Branch 7 taken 2 times.
|
12 | if (boost::optional<ZoneHVACComponent> znLowTempRadVar = coilHLRC->containingZoneHVACComponent()) { |
| 270 | //translate and map containingZoneHVACBBConvWater | ||
| 271 |
4/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 2 times.
|
8 | if (boost::optional<IdfObject> idfZnLowTempRadVar = this->translateAndMapModelObject(*znLowTempRadVar)) { |
| 272 | //Get the name and the idd object from the idf object version of this | ||
| 273 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | objectName = idfZnLowTempRadVar->name().get(); |
| 274 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | iddType = idfZnLowTempRadVar->iddObject().name(); |
| 275 | 4 | } | |
| 276 | 6 | } | |
| 277 | 247 | } | |
| 278 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 243 times.
|
494 | if (boost::optional<CoilCoolingLowTempRadiantVarFlow> coilCLRC = modelObject.optionalCast<CoilCoolingLowTempRadiantVarFlow>()) { |
| 279 |
3/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
|
8 | if (boost::optional<ZoneHVACComponent> znLowTempRadVar = coilCLRC->containingZoneHVACComponent()) { |
| 280 | //translate and map containingZoneHVACBBConvWater | ||
| 281 |
4/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 2 times.
|
8 | if (boost::optional<IdfObject> idfZnLowTempRadVar = this->translateAndMapModelObject(*znLowTempRadVar)) { |
| 282 | //Get the name and the idd object from the idf object version of this | ||
| 283 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | objectName = idfZnLowTempRadVar->name().get(); |
| 284 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | iddType = idfZnLowTempRadVar->iddObject().name(); |
| 285 | 4 | } | |
| 286 | 4 | } | |
| 287 | 247 | } | |
| 288 | //special case for Generator:MicroTurbine. | ||
| 289 | //In OpenStudio, this object was broken into 2 objects: | ||
| 290 | //GeneratorMicroTurbine and GeneratorMicroTurbineHeatRecovery. | ||
| 291 | //The GeneratorMicroTurbineHeatRecovery goes onto the plantloop. In order to get the correct translation to E+, we need | ||
| 292 | //to put the name of the linked GeneratorMicroTurbine onto the branch. | ||
| 293 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 245 times.
|
494 | if (boost::optional<GeneratorMicroTurbineHeatRecovery> mchpHR = modelObject.optionalCast<GeneratorMicroTurbineHeatRecovery>()) { |
| 294 |
4/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
|
4 | if (boost::optional<GeneratorMicroTurbine> mchp = mchpHR->generatorMicroTurbine()) { |
| 295 | //translate and map containingZoneHVACBBConvWater | ||
| 296 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (boost::optional<IdfObject> idfmchp = this->translateAndMapModelObject(*mchp)) { |
| 297 | //Get the name and the idd object from the idf object version of this | ||
| 298 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | objectName = idfmchp->name().get(); |
| 299 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | iddType = idfmchp->iddObject().name(); |
| 300 | 2 | } | |
| 301 | 2 | } | |
| 302 | 247 | } | |
| 303 | |||
| 304 | // special case for HeatPumpAirToWaterCooling and HeatPumpAirToWaterHeating | ||
| 305 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 245 times.
|
494 | if (auto awhp_cc_ = modelObject.optionalCast<HeatPumpAirToWaterCooling>()) { |
| 306 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (auto awhp = awhp_cc_->containingHVACComponent()) { |
| 307 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (auto idf_awhp = this->translateAndMapModelObject(*awhp)) { |
| 308 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | objectName = idf_awhp->name().get(); |
| 309 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | iddType = idf_awhp->iddObject().name(); |
| 310 | 2 | } | |
| 311 | 2 | } | |
| 312 | 247 | } | |
| 313 | |||
| 314 |
3/3✓ Branch 1 taken 247 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 244 times.
|
494 | if (auto awhp_hc_ = modelObject.optionalCast<HeatPumpAirToWaterHeating>()) { |
| 315 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
|
6 | if (auto awhp = awhp_hc_->containingHVACComponent()) { |
| 316 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
|
6 | if (auto idf_awhp = this->translateAndMapModelObject(*awhp)) { |
| 317 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | objectName = idf_awhp->name().get(); |
| 318 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | iddType = idf_awhp->iddObject().name(); |
| 319 | 3 | } | |
| 320 | 3 | } | |
| 321 | 247 | } | |
| 322 | |||
| 323 |
3/3✓ Branch 1 taken 288 times.
✓ Branch 3 taken 37 times.
✓ Branch 4 taken 251 times.
|
576 | } else if (auto waterToAirComponent = modelObject.optionalCast<WaterToAirComponent>()) { |
| 324 |
3/3✓ Branch 1 taken 37 times.
✓ Branch 4 taken 32 times.
✓ Branch 5 taken 5 times.
|
74 | if (loop.optionalCast<PlantLoop>()) { |
| 325 |
4/4✓ Branch 1 taken 32 times.
✓ Branch 4 taken 32 times.
✓ Branch 7 taken 32 times.
✓ Branch 10 taken 32 times.
|
32 | inletNode = waterToAirComponent->waterInletModelObject()->optionalCast<Node>(); |
| 326 |
4/4✓ Branch 1 taken 32 times.
✓ Branch 4 taken 32 times.
✓ Branch 7 taken 32 times.
✓ Branch 10 taken 32 times.
|
32 | outletNode = waterToAirComponent->waterOutletModelObject()->optionalCast<Node>(); |
| 327 | } else { | ||
| 328 |
4/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
|
5 | inletNode = waterToAirComponent->airInletModelObject()->optionalCast<Node>(); |
| 329 |
4/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
|
5 | outletNode = waterToAirComponent->airOutletModelObject()->optionalCast<Node>(); |
| 330 | } | ||
| 331 |
3/3✓ Branch 1 taken 251 times.
✓ Branch 3 taken 87 times.
✓ Branch 4 taken 164 times.
|
502 | } else if (auto waterToWaterComponent = modelObject.optionalCast<WaterToWaterComponent>()) { |
| 332 | // Special case for CentralHeatPump. | ||
| 333 | // Unlike other WaterToWaterComponent with a tertiary loop (ChillerAbsorption, ChillerAbsorptionIndirect, ChillerElectricEIR, ChillerElectricReformulatedEIR) which all have | ||
| 334 | // tertiary loop = demand side (so 2 demand side loops and one supply), CentralHeatPumpSystem has tertiary = supply (2 supply side and 1 | ||
| 335 | // demand side loops) | ||
| 336 |
3/3✓ Branch 1 taken 87 times.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 78 times.
|
174 | if (auto central_hp = modelObject.optionalCast<CentralHeatPumpSystem>()) { |
| 337 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | auto coolingLoop = central_hp->coolingPlantLoop(); |
| 338 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | auto heatingLoop = central_hp->heatingPlantLoop(); |
| 339 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | auto sourceLoop = central_hp->sourcePlantLoop(); |
| 340 | |||
| 341 | // supply = cooling Loop | ||
| 342 |
9/10✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 9 times.
✓ Branch 6 taken 9 times.
✓ Branch 9 taken 9 times.
✓ Branch 12 taken 9 times.
✓ Branch 14 taken 3 times.
✓ Branch 15 taken 6 times.
✓ Branch 16 taken 3 times.
✓ Branch 17 taken 6 times.
|
9 | if (coolingLoop && loop.handle() == coolingLoop->handle()) { |
| 343 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | inletNode = waterToWaterComponent->supplyInletModelObject()->optionalCast<Node>(); |
| 344 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | outletNode = waterToWaterComponent->supplyOutletModelObject()->optionalCast<Node>(); |
| 345 | |||
| 346 | // tertiary = heating loop | ||
| 347 |
9/10✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 6 times.
✓ Branch 6 taken 6 times.
✓ Branch 9 taken 6 times.
✓ Branch 12 taken 6 times.
✓ Branch 14 taken 3 times.
✓ Branch 15 taken 3 times.
✓ Branch 16 taken 3 times.
✓ Branch 17 taken 3 times.
|
6 | } else if (heatingLoop && loop.handle() == heatingLoop->handle()) { |
| 348 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | inletNode = waterToWaterComponent->tertiaryInletModelObject()->optionalCast<Node>(); |
| 349 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | outletNode = waterToWaterComponent->tertiaryOutletModelObject()->optionalCast<Node>(); |
| 350 | |||
| 351 | // demand = source loop | ||
| 352 |
7/10✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 6 taken 3 times.
✓ Branch 9 taken 3 times.
✓ Branch 12 taken 3 times.
✓ Branch 14 taken 3 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 3 times.
✗ Branch 17 not taken.
|
3 | } else if (sourceLoop && loop.handle() == sourceLoop->handle()) { |
| 353 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | inletNode = waterToWaterComponent->demandInletModelObject()->optionalCast<Node>(); |
| 354 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | outletNode = waterToWaterComponent->demandOutletModelObject()->optionalCast<Node>(); |
| 355 | } | ||
| 356 | |||
| 357 |
3/3✓ Branch 4 taken 78 times.
✓ Branch 6 taken 7 times.
✓ Branch 7 taken 71 times.
|
165 | } else if (auto ch = modelObject.optionalCast<ChillerElectricASHRAE205>()) { |
| 358 | // This one has **FIVE** loops and can be potentially several time on the same loop (demand side, eg: Condenser + Oil Cooler + Auxiliary) | ||
| 359 | |||
| 360 | // Doing this: `if (ch->chilledWaterLoop() && loop.handle() == ch->chilledWaterLoop()->handle())` isn't enough because we could be on the | ||
| 361 | // same loop, so we rely on prevNode_ instead | ||
| 362 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(prevNode_); |
| 363 | |||
| 364 |
18/23✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 4 times.
✓ Branch 8 taken 3 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
✓ Branch 16 taken 4 times.
✓ Branch 19 taken 4 times.
✓ Branch 22 taken 4 times.
✓ Branch 25 taken 4 times.
✓ Branch 28 taken 4 times.
✓ Branch 30 taken 1 time.
✓ Branch 31 taken 3 times.
✓ Branch 32 taken 4 times.
✓ Branch 33 taken 3 times.
✓ Branch 35 taken 7 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 1 time.
✓ Branch 39 taken 6 times.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
14 | if (ch->chilledWaterInletNode() && ch->chilledWaterInletNode()->handle() == prevNode_->handle()) { |
| 365 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | inletNode = ch->chilledWaterInletNode(); |
| 366 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | outletNode = ch->chilledWaterOutletNode(); |
| 367 |
16/23✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 6 times.
✓ Branch 13 taken 6 times.
✓ Branch 16 taken 6 times.
✓ Branch 19 taken 6 times.
✓ Branch 22 taken 6 times.
✓ Branch 25 taken 6 times.
✓ Branch 28 taken 6 times.
✓ Branch 30 taken 2 times.
✓ Branch 31 taken 4 times.
✓ Branch 32 taken 6 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 6 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 2 times.
✓ Branch 39 taken 4 times.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
12 | } else if (ch->condenserInletNode() && ch->condenserInletNode()->handle() == prevNode_->handle()) { |
| 368 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | inletNode = ch->condenserInletNode(); |
| 369 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | outletNode = ch->condenserOutletNode(); |
| 370 |
6/23✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 10 not taken.
✗ Branch 13 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✗ Branch 25 not taken.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✓ Branch 33 taken 4 times.
✓ Branch 35 taken 4 times.
✗ Branch 36 not taken.
✗ Branch 38 not taken.
✓ Branch 39 taken 4 times.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
8 | } else if (ch->heatRecoveryInletNode() && ch->heatRecoveryInletNode()->handle() == prevNode_->handle()) { |
| 371 | ✗ | inletNode = ch->heatRecoveryInletNode(); | |
| 372 | ✗ | outletNode = ch->heatRecoveryOutletNode(); | |
| 373 |
16/23✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
✓ Branch 16 taken 4 times.
✓ Branch 19 taken 4 times.
✓ Branch 22 taken 4 times.
✓ Branch 25 taken 4 times.
✓ Branch 28 taken 4 times.
✓ Branch 30 taken 2 times.
✓ Branch 31 taken 2 times.
✓ Branch 32 taken 4 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 4 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 2 times.
✓ Branch 39 taken 2 times.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
8 | } else if (ch->oilCoolerInletNode() && ch->oilCoolerInletNode()->handle() == prevNode_->handle()) { |
| 374 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | inletNode = ch->oilCoolerInletNode(); |
| 375 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | outletNode = ch->oilCoolerOutletNode(); |
| 376 |
14/23✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 19 taken 2 times.
✓ Branch 22 taken 2 times.
✓ Branch 25 taken 2 times.
✓ Branch 28 taken 2 times.
✓ Branch 30 taken 2 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 2 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 2 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 2 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
4 | } else if (ch->auxiliaryInletNode() && ch->auxiliaryInletNode()->handle() == prevNode_->handle()) { |
| 377 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | inletNode = ch->auxiliaryInletNode(); |
| 378 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | outletNode = ch->auxiliaryOutletNode(); |
| 379 | } | ||
| 380 | |||
| 381 | // Regular case | ||
| 382 |
2/2✓ Branch 0 taken 56 times.
✓ Branch 1 taken 15 times.
|
71 | } else if (isSupplyBranch) { |
| 383 |
4/4✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
✓ Branch 7 taken 56 times.
✓ Branch 10 taken 56 times.
|
56 | inletNode = waterToWaterComponent->supplyInletModelObject()->optionalCast<Node>(); |
| 384 |
4/4✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
✓ Branch 7 taken 56 times.
✓ Branch 10 taken 56 times.
|
56 | outletNode = waterToWaterComponent->supplyOutletModelObject()->optionalCast<Node>(); |
| 385 | |||
| 386 | // WaterHeater:Mixed with Source Side nodes on supply branch | ||
| 387 |
3/3✓ Branch 1 taken 56 times.
✓ Branch 3 taken 30 times.
✓ Branch 4 taken 26 times.
|
112 | if (auto water_heater_mixed = modelObject.optionalCast<WaterHeaterMixed>()) { |
| 388 |
4/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 6 taken 3 times.
✓ Branch 7 taken 27 times.
|
60 | if (boost::optional<PlantLoop> sourceSidePlantLoop = water_heater_mixed->sourceSidePlantLoop()) { |
| 389 |
6/6✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 12 taken 1 time.
✓ Branch 13 taken 2 times.
|
3 | if (loop.handle() == sourceSidePlantLoop->handle()) { |
| 390 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | inletNode = waterToWaterComponent->demandInletModelObject()->optionalCast<Node>(); |
| 391 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | outletNode = waterToWaterComponent->demandOutletModelObject()->optionalCast<Node>(); |
| 392 | } | ||
| 393 | 30 | } | |
| 394 | 56 | } | |
| 395 | |||
| 396 | // WaterHeater:Stratified with Source Side nodes on supply branch | ||
| 397 |
3/3✓ Branch 1 taken 56 times.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 47 times.
|
112 | if (auto water_heater_stratified = modelObject.optionalCast<WaterHeaterStratified>()) { |
| 398 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 7 times.
|
18 | if (boost::optional<PlantLoop> sourceSidePlantLoop = water_heater_stratified->sourceSidePlantLoop()) { |
| 399 |
6/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 12 taken 1 time.
✓ Branch 13 taken 1 time.
|
2 | if (loop.handle() == sourceSidePlantLoop->handle()) { |
| 400 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | inletNode = waterToWaterComponent->demandInletModelObject()->optionalCast<Node>(); |
| 401 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | outletNode = waterToWaterComponent->demandOutletModelObject()->optionalCast<Node>(); |
| 402 | } | ||
| 403 | 9 | } | |
| 404 | 56 | } | |
| 405 | } else { | ||
| 406 |
4/4✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 6 taken 4 times.
✓ Branch 7 taken 11 times.
|
30 | if (auto tertiaryInletModelObject = waterToWaterComponent->tertiaryInletModelObject()) { |
| 407 |
3/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
|
8 | if (auto tertiaryInletNode = tertiaryInletModelObject->optionalCast<Node>()) { |
| 408 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 2 times.
✓ Branch 11 taken 2 times.
|
8 | if (loop.demandComponent(tertiaryInletNode->handle())) { |
| 409 |
1/1✓ Branch 1 taken 2 times.
|
2 | inletNode = tertiaryInletNode; |
| 410 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (auto tertiaryOutletModelObject = waterToWaterComponent->tertiaryOutletModelObject()) { |
| 411 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | outletNode = tertiaryOutletModelObject->optionalCast<Node>(); |
| 412 | 2 | } | |
| 413 | } | ||
| 414 | 4 | } | |
| 415 | 15 | } | |
| 416 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 2 taken 2 times.
|
15 | if (!inletNode) { |
| 417 |
4/4✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✓ Branch 10 taken 13 times.
|
13 | inletNode = waterToWaterComponent->demandInletModelObject()->optionalCast<Node>(); |
| 418 |
4/4✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✓ Branch 10 taken 13 times.
|
13 | outletNode = waterToWaterComponent->demandOutletModelObject()->optionalCast<Node>(); |
| 419 | } | ||
| 420 | 165 | } | |
| 421 | //special case for WaterHeater:HeatPump. In E+, this object appears on both the | ||
| 422 | //zonehvac:equipmentlist and the branch. In OpenStudio the tank (WaterHeater:Mixed) | ||
| 423 | //is attached to the plant and the WaterHeaterHeatPump is connected to the zone and zonehvac equipment list. | ||
| 424 | //Here we resolve all of that since it is the WaterHeaterHeatPump that must show up on both | ||
| 425 |
3/3✓ Branch 1 taken 87 times.
✓ Branch 3 taken 31 times.
✓ Branch 4 taken 56 times.
|
174 | if (auto tank = modelObject.optionalCast<WaterHeaterMixed>()) { |
| 426 | // containingZoneHVACComponent can be WaterHeaterHeatPump | ||
| 427 |
3/4✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 31 times.
|
62 | if (auto hpwh = tank->containingZoneHVACComponent()) { |
| 428 | //translate and map containingZoneHVAC | ||
| 429 | ✗ | if (auto hpwhIDF = translateAndMapModelObject(hpwh.get())) { | |
| 430 | //Get the name and the idd object from the idf object version of this | ||
| 431 | ✗ | objectName = hpwhIDF->name().get(); | |
| 432 | ✗ | iddType = hpwhIDF->iddObject().name(); | |
| 433 | ✗ | } | |
| 434 | 31 | } | |
| 435 | 87 | } | |
| 436 |
3/3✓ Branch 1 taken 87 times.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 78 times.
|
174 | if (auto tank = modelObject.optionalCast<WaterHeaterStratified>()) { |
| 437 | // containingZoneHVACComponent can be WaterHeaterHeatPump | ||
| 438 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 7 times.
|
18 | if (auto hpwh = tank->containingZoneHVACComponent()) { |
| 439 | //translate and map containingZoneHVAC | ||
| 440 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (auto hpwhIDF = translateAndMapModelObject(hpwh.get())) { |
| 441 | //Get the name and the idd object from the idf object version of this | ||
| 442 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | objectName = hpwhIDF->name().get(); |
| 443 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | iddType = hpwhIDF->iddObject().name(); |
| 444 | 2 | } | |
| 445 | 9 | } | |
| 446 | 87 | } | |
| 447 |
3/3✓ Branch 1 taken 164 times.
✓ Branch 3 taken 53 times.
✓ Branch 4 taken 111 times.
|
328 | } else if (auto oaSystem = modelObject.optionalCast<AirLoopHVACOutdoorAirSystem>()) { |
| 448 |
4/4✓ Branch 1 taken 53 times.
✓ Branch 4 taken 53 times.
✓ Branch 7 taken 53 times.
✓ Branch 10 taken 53 times.
|
53 | inletNode = oaSystem->returnAirModelObject()->optionalCast<Node>(); |
| 449 |
4/4✓ Branch 1 taken 53 times.
✓ Branch 4 taken 53 times.
✓ Branch 7 taken 53 times.
✓ Branch 10 taken 53 times.
|
53 | outletNode = oaSystem->mixedAirModelObject()->optionalCast<Node>(); |
| 450 |
3/3✓ Branch 1 taken 111 times.
✓ Branch 3 taken 75 times.
✓ Branch 4 taken 36 times.
|
222 | } else if (auto unitary = modelObject.optionalCast<ZoneHVACComponent>()) { |
| 451 |
4/4✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
✓ Branch 7 taken 75 times.
✓ Branch 10 taken 75 times.
|
75 | inletNode = unitary->inletNode()->optionalCast<Node>(); |
| 452 |
4/4✓ Branch 1 taken 75 times.
✓ Branch 4 taken 75 times.
✓ Branch 7 taken 75 times.
✓ Branch 10 taken 75 times.
|
75 | outletNode = unitary->outletNode()->optionalCast<Node>(); |
| 453 | 1349 | } | |
| 454 | |||
| 455 |
5/6✓ Branch 0 taken 499 times.
✓ Branch 1 taken 36 times.
✓ Branch 2 taken 499 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 499 times.
✓ Branch 5 taken 36 times.
|
1034 | if (inletNode && outletNode) { |
| 456 |
1/1✓ Branch 1 taken 499 times.
|
499 | IdfExtensibleGroup eg = branchIdfObject.pushExtensibleGroup(); |
| 457 |
1/1✓ Branch 1 taken 499 times.
|
499 | eg.setString(BranchExtensibleFields::ComponentObjectType, iddType); |
| 458 |
1/1✓ Branch 1 taken 499 times.
|
499 | eg.setString(BranchExtensibleFields::ComponentName, objectName); |
| 459 |
4/4✓ Branch 1 taken 499 times.
✓ Branch 4 taken 499 times.
✓ Branch 7 taken 499 times.
✓ Branch 10 taken 499 times.
|
499 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNode->name().get()); |
| 460 |
4/4✓ Branch 1 taken 499 times.
✓ Branch 4 taken 499 times.
✓ Branch 7 taken 499 times.
✓ Branch 10 taken 499 times.
|
499 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNode->name().get()); |
| 461 | 499 | } | |
| 462 | |||
| 463 | 535 | i++; | |
| 464 | 4299 | } | |
| 465 | 416 | } | |
| 466 | |||
| 467 | 416 | return branchIdfObject; | |
| 468 | } | ||
| 469 | |||
| 470 | 240 | boost::optional<IdfObject> ForwardTranslator::translatePlantLoop(PlantLoop& plantLoop) { | |
| 471 | // Create a new IddObjectType::PlantLoop | ||
| 472 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject idfObject(IddObjectType::PlantLoop); |
| 473 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(idfObject); |
| 474 | |||
| 475 |
2/4✓ Branch 1 taken 240 times.
✗ Branch 7 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 240 times.
|
240 | for (LifeCycleCost lifeCycleCost : plantLoop.lifeCycleCosts()) { |
| 476 | ✗ | translateAndMapModelObject(lifeCycleCost); | |
| 477 | 240 | } | |
| 478 | |||
| 479 | 240 | OptionalModelObject temp; | |
| 480 | 240 | boost::optional<std::string> s; | |
| 481 | 240 | boost::optional<double> value; | |
| 482 | |||
| 483 | // Name | ||
| 484 | |||
| 485 |
2/3✓ Branch 1 taken 240 times.
✓ Branch 5 taken 240 times.
✗ Branch 6 not taken.
|
480 | if ((s = plantLoop.name())) { |
| 486 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | idfObject.setName(s.get()); |
| 487 | } | ||
| 488 | |||
| 489 | // Fluid Type | ||
| 490 | |||
| 491 |
3/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 8 taken 240 times.
✗ Branch 9 not taken.
|
480 | if ((s = plantLoop.fluidType())) { |
| 492 |
17/28✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 9 taken 185 times.
✓ Branch 10 taken 55 times.
✓ Branch 12 taken 185 times.
✓ Branch 15 taken 185 times.
✓ Branch 18 taken 185 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 185 times.
✓ Branch 22 taken 185 times.
✓ Branch 23 taken 55 times.
✓ Branch 25 taken 185 times.
✓ Branch 26 taken 55 times.
✓ Branch 27 taken 240 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 240 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 55 times.
✓ Branch 33 taken 185 times.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
|
1090 | if (istringEqual(s.get(), "PropyleneGlycol") || istringEqual(s.get(), "EthyleneGlycol")) { |
| 493 |
2/2✓ Branch 1 taken 55 times.
✓ Branch 4 taken 55 times.
|
55 | idfObject.setString(PlantLoopFields::FluidType, "UserDefinedFluidType"); |
| 494 |
2/2✓ Branch 1 taken 55 times.
✓ Branch 4 taken 55 times.
|
55 | boost::optional<int> gc = plantLoop.glycolConcentration(); |
| 495 |
1/2✓ Branch 0 taken 55 times.
✗ Branch 1 not taken.
|
55 | if (gc) { |
| 496 |
3/3✓ Branch 1 taken 55 times.
✓ Branch 4 taken 55 times.
✓ Branch 7 taken 55 times.
|
55 | boost::optional<IdfObject> fluidProperties = createFluidProperties(s.get(), gc.get()); |
| 497 |
1/2✓ Branch 0 taken 55 times.
✗ Branch 1 not taken.
|
55 | if (fluidProperties) { |
| 498 |
2/2✓ Branch 1 taken 55 times.
✓ Branch 4 taken 55 times.
|
55 | boost::optional<std::string> fluidPropertiesName = fluidProperties->getString(FluidProperties_NameFields::FluidName, true); |
| 499 |
1/2✓ Branch 0 taken 55 times.
✗ Branch 1 not taken.
|
55 | if (fluidPropertiesName) { |
| 500 |
2/2✓ Branch 1 taken 55 times.
✓ Branch 4 taken 55 times.
|
55 | idfObject.setString(PlantLoopFields::UserDefinedFluidType, fluidPropertiesName.get()); |
| 501 | } | ||
| 502 | 55 | } | |
| 503 | 55 | } | |
| 504 | |||
| 505 | } else { | ||
| 506 |
2/2✓ Branch 1 taken 185 times.
✓ Branch 4 taken 185 times.
|
185 | idfObject.setString(PlantLoopFields::FluidType, s.get()); |
| 507 | } | ||
| 508 | } | ||
| 509 | |||
| 510 | // Loop Temperature Setpoint Node Name | ||
| 511 | |||
| 512 |
3/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 8 taken 240 times.
✗ Branch 9 not taken.
|
480 | if (boost::optional<Node> node = plantLoop.loopTemperatureSetpointNode()) { |
| 513 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::LoopTemperatureSetpointNodeName, node->name().get()); |
| 514 | 240 | } | |
| 515 | |||
| 516 | // Maximum Loop Temperature | ||
| 517 | |||
| 518 |
3/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✗ Branch 8 not taken.
|
480 | if ((value = plantLoop.maximumLoopTemperature())) { |
| 519 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | idfObject.setDouble(PlantLoopFields::MaximumLoopTemperature, value.get()); |
| 520 | } | ||
| 521 | |||
| 522 | // Minimum Loop Temperature | ||
| 523 | |||
| 524 |
3/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✗ Branch 8 not taken.
|
480 | if ((value = plantLoop.minimumLoopTemperature())) { |
| 525 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | idfObject.setDouble(PlantLoopFields::MinimumLoopTemperature, value.get()); |
| 526 | } | ||
| 527 | |||
| 528 | // Maximum Loop Flow Rate | ||
| 529 | |||
| 530 |
2/3✓ Branch 1 taken 240 times.
✓ Branch 3 taken 240 times.
✗ Branch 4 not taken.
|
240 | if (plantLoop.isMaximumLoopFlowRateAutosized()) { |
| 531 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
480 | idfObject.setString(PlantLoopFields::MaximumLoopFlowRate, "Autosize"); |
| 532 | ✗ | } else if ((value = plantLoop.maximumLoopFlowRate())) { | |
| 533 | ✗ | idfObject.setDouble(PlantLoopFields::MaximumLoopFlowRate, value.get()); | |
| 534 | } | ||
| 535 | |||
| 536 | // Minimum Loop Flow Rate | ||
| 537 | |||
| 538 |
2/3✓ Branch 1 taken 240 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 240 times.
|
240 | if (plantLoop.isMinimumLoopFlowRateAutosized()) { |
| 539 | ✗ | idfObject.setString(PlantLoopFields::MinimumLoopFlowRate, "Autosize"); | |
| 540 |
2/3✓ Branch 1 taken 240 times.
✓ Branch 3 taken 240 times.
✗ Branch 4 not taken.
|
480 | } else if ((value = plantLoop.minimumLoopFlowRate())) { |
| 541 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | idfObject.setDouble(PlantLoopFields::MinimumLoopFlowRate, value.get()); |
| 542 | } | ||
| 543 | |||
| 544 | // LoadDistributionScheme | ||
| 545 | { | ||
| 546 |
1/1✓ Branch 1 taken 240 times.
|
240 | auto scheme = plantLoop.loadDistributionScheme(); |
| 547 |
1/1✓ Branch 1 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::LoadDistributionScheme, scheme); |
| 548 | 240 | } | |
| 549 | |||
| 550 | // AvailabilityManagerAssignmentList | ||
| 551 | { | ||
| 552 | // The AvailabilityManagerAssignment list is translated by itself, we just need to set its name on the right IDF field | ||
| 553 |
1/1✓ Branch 3 taken 240 times.
|
240 | AvailabilityManagerAssignmentList avmList = plantLoop.getImpl<openstudio::model::detail::PlantLoop_Impl>()->availabilityManagerAssignmentList(); |
| 554 | |||
| 555 | // If the avmList isn't empty of just with an HybridVentilation, it should have been translated | ||
| 556 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 3 taken 14 times.
✓ Branch 4 taken 226 times.
|
480 | if (boost::optional<IdfObject> _avmList = this->translateAndMapModelObject(avmList)) { |
| 557 |
4/4✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
✓ Branch 10 taken 14 times.
|
14 | idfObject.setString(PlantLoopFields::AvailabilityManagerListName, _avmList->name().get()); |
| 558 | 240 | } | |
| 559 | 240 | } | |
| 560 | |||
| 561 | // PlantLoopDemandCalculationScheme | ||
| 562 | { | ||
| 563 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | auto spms = plantLoop.supplyOutletNode().setpointManagers(); |
| 564 |
2/3✓ Branch 1 taken 240 times.
✓ Branch 5 taken 240 times.
✗ Branch 6 not taken.
|
240 | if (subsetCastVector<model::SetpointManagerScheduledDualSetpoint>(spms).empty()) { |
| 565 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
480 | idfObject.setString(PlantLoopFields::PlantLoopDemandCalculationScheme, "SingleSetpoint"); |
| 566 | } else { | ||
| 567 | ✗ | idfObject.setString(PlantLoopFields::PlantLoopDemandCalculationScheme, "DualSetpointDeadband"); | |
| 568 | } | ||
| 569 | 240 | } | |
| 570 | |||
| 571 | // Plant Loop Volume | ||
| 572 | |||
| 573 |
2/3✓ Branch 1 taken 240 times.
✓ Branch 3 taken 240 times.
✗ Branch 4 not taken.
|
240 | if (plantLoop.isPlantLoopVolumeAutocalculated()) { |
| 574 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
480 | idfObject.setString(PlantLoopFields::PlantLoopVolume, "Autocalculate"); |
| 575 | ✗ | } else if ((value = plantLoop.plantLoopVolume())) { | |
| 576 | ✗ | idfObject.setDouble(PlantLoopFields::PlantLoopVolume, value.get()); | |
| 577 | } | ||
| 578 | |||
| 579 | // Common Pipe Simulation | ||
| 580 | |||
| 581 |
3/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 8 taken 240 times.
✗ Branch 9 not taken.
|
480 | if ((s = plantLoop.commonPipeSimulation())) { |
| 582 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::CommonPipeSimulation, s.get()); |
| 583 | } | ||
| 584 | |||
| 585 | // Inlet/Outlet Nodes | ||
| 586 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::PlantSideInletNodeName, plantLoop.supplyInletNode().name().get()); |
| 587 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::PlantSideOutletNodeName, plantLoop.supplyOutletNode().name().get()); |
| 588 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::DemandSideInletNodeName, plantLoop.demandInletNode().name().get()); |
| 589 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::DemandSideOutletNodeName, plantLoop.demandOutletNode().name().get()); |
| 590 | |||
| 591 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
480 | auto supplyComponents = plantLoop.supplyComponents(); |
| 592 | |||
| 593 |
1/1✓ Branch 1 taken 240 times.
|
240 | SizingPlant sizingPlant = plantLoop.sizingPlant(); |
| 594 |
1/1✓ Branch 1 taken 240 times.
|
240 | translateAndMapModelObject(sizingPlant); |
| 595 | |||
| 596 | // Mark where we want the plant operation schemes to go | ||
| 597 | // Don't actually translate yet because we don't want the components to show up yet | ||
| 598 | // auto operationSchemeLocation = std::distance(m_idfObjects.begin(),m_idfObjects.end()); | ||
| 599 | |||
| 600 | // Supply Side | ||
| 601 | |||
| 602 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _supplyBranchList(IddObjectType::BranchList); |
| 603 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _supplyBranchList.setName(plantLoop.name().get() + " Supply Branches"); |
| 604 |
1/1✓ Branch 1 taken 240 times.
|
240 | _supplyBranchList.clearExtensibleGroups(); |
| 605 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_supplyBranchList); |
| 606 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::PlantSideBranchListName, _supplyBranchList.name().get()); |
| 607 | |||
| 608 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _supplyConnectorList(IddObjectType::ConnectorList); |
| 609 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _supplyConnectorList.setName(plantLoop.name().get() + " Supply Connector List"); |
| 610 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_supplyConnectorList); |
| 611 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::PlantSideConnectorListName, _supplyConnectorList.name().get()); |
| 612 | |||
| 613 |
1/1✓ Branch 1 taken 240 times.
|
240 | Splitter supplySplitter = plantLoop.supplySplitter(); |
| 614 |
1/1✓ Branch 1 taken 240 times.
|
240 | Mixer supplyMixer = plantLoop.supplyMixer(); |
| 615 | |||
| 616 |
1/1✓ Branch 1 taken 240 times.
|
240 | Node supplyInletNode = plantLoop.supplyInletNode(); |
| 617 |
1/1✓ Branch 1 taken 240 times.
|
240 | Node supplyOutletNode = plantLoop.supplyOutletNode(); |
| 618 | |||
| 619 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _supplySplitter(IddObjectType::Connector_Splitter); |
| 620 |
1/1✓ Branch 1 taken 240 times.
|
240 | _supplySplitter.clearExtensibleGroups(); |
| 621 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _supplySplitter.setName(plantLoop.name().get() + " Supply Splitter"); |
| 622 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_supplySplitter); |
| 623 |
1/1✓ Branch 1 taken 240 times.
|
240 | ExtensibleIndex ei2(0, 0); |
| 624 | 240 | ei2.group = 0; | |
| 625 | 240 | ei2.field = ConnectorListExtensibleFields::ConnectorObjectType; | |
| 626 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _supplyConnectorList.setString(_supplyConnectorList.iddObject().index(ei2), _supplySplitter.iddObject().name()); |
| 627 | 240 | ei2.field = ConnectorListExtensibleFields::ConnectorName; | |
| 628 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _supplyConnectorList.setString(_supplyConnectorList.iddObject().index(ei2), _supplySplitter.name().get()); |
| 629 | |||
| 630 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _supplyMixer(IddObjectType::Connector_Mixer); |
| 631 |
1/1✓ Branch 1 taken 240 times.
|
240 | _supplyMixer.clearExtensibleGroups(); |
| 632 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _supplyMixer.setName(plantLoop.name().get() + " Supply Mixer"); |
| 633 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_supplyMixer); |
| 634 | 240 | ei2.group = 1; | |
| 635 | 240 | ei2.field = ConnectorListExtensibleFields::ConnectorObjectType; | |
| 636 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _supplyConnectorList.setString(_supplyConnectorList.iddObject().index(ei2), _supplyMixer.iddObject().name()); |
| 637 | 240 | ei2.field = ConnectorListExtensibleFields::ConnectorName; | |
| 638 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _supplyConnectorList.setString(_supplyConnectorList.iddObject().index(ei2), _supplyMixer.name().get()); |
| 639 | |||
| 640 | // Supply inlet branch | ||
| 641 | |||
| 642 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _supplyInletBranch(IddObjectType::Branch); |
| 643 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _supplyInletBranch.setName(plantLoop.name().get() + " Supply Inlet Branch"); |
| 644 |
1/1✓ Branch 1 taken 240 times.
|
240 | _supplyInletBranch.clearExtensibleGroups(); |
| 645 |
1/1✓ Branch 1 taken 240 times.
|
240 | IdfExtensibleGroup eg = _supplyBranchList.pushExtensibleGroup(); |
| 646 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchListExtensibleFields::BranchName, _supplyInletBranch.name().get()); |
| 647 | |||
| 648 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | _supplySplitter.setString(Connector_SplitterFields::InletBranchName, _supplyInletBranch.name().get()); |
| 649 | |||
| 650 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_supplyInletBranch); |
| 651 | |||
| 652 | 240 | std::vector<ModelObject> supplyInletModelObjects; | |
| 653 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
480 | supplyInletModelObjects = plantLoop.supplyComponents(supplyInletNode, supplySplitter); |
| 654 | |||
| 655 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✗ Branch 4 not taken.
|
240 | OS_ASSERT(supplyInletModelObjects.size() >= 2); |
| 656 | |||
| 657 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 2 taken 226 times.
|
240 | if (supplyInletModelObjects.size() > 2u) { |
| 658 |
1/1✓ Branch 1 taken 14 times.
|
14 | populateBranch(_supplyInletBranch, supplyInletModelObjects, plantLoop, true); |
| 659 | } else { | ||
| 660 |
2/2✓ Branch 1 taken 226 times.
✓ Branch 4 taken 226 times.
|
226 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 661 |
4/4✓ Branch 1 taken 226 times.
✓ Branch 4 taken 226 times.
✓ Branch 7 taken 226 times.
✓ Branch 10 taken 226 times.
|
226 | pipe.setName(plantLoop.name().get() + " Supply Inlet Pipe"); |
| 662 |
1/1✓ Branch 1 taken 226 times.
|
226 | m_idfObjects.push_back(pipe); |
| 663 | |||
| 664 |
4/4✓ Branch 1 taken 226 times.
✓ Branch 4 taken 226 times.
✓ Branch 7 taken 226 times.
✓ Branch 10 taken 226 times.
|
226 | std::string inletNodeName = plantLoop.supplyInletNode().name().get(); |
| 665 |
3/3✓ Branch 1 taken 226 times.
✓ Branch 4 taken 226 times.
✓ Branch 7 taken 226 times.
|
226 | std::string outletNodeName = plantLoop.name().get() + " Supply Inlet Pipe Node"; |
| 666 | |||
| 667 |
1/1✓ Branch 1 taken 226 times.
|
226 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 668 |
1/1✓ Branch 1 taken 226 times.
|
226 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 669 | |||
| 670 |
1/1✓ Branch 1 taken 226 times.
|
226 | IdfExtensibleGroup eg = _supplyInletBranch.pushExtensibleGroup(); |
| 671 |
3/3✓ Branch 1 taken 226 times.
✓ Branch 4 taken 226 times.
✓ Branch 7 taken 226 times.
|
226 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 672 |
3/3✓ Branch 1 taken 226 times.
✓ Branch 4 taken 226 times.
✓ Branch 7 taken 226 times.
|
226 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 673 |
1/1✓ Branch 1 taken 226 times.
|
226 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 674 |
1/1✓ Branch 1 taken 226 times.
|
226 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 675 | 226 | } | |
| 676 | |||
| 677 | // Populate supply equipment branches | ||
| 678 | |||
| 679 |
1/1✓ Branch 1 taken 240 times.
|
240 | std::vector<model::ModelObject> splitterOutletObjects = supplySplitter.outletModelObjects(); |
| 680 |
1/1✓ Branch 1 taken 240 times.
|
240 | std::vector<model::ModelObject> mixerInletObjects = supplyMixer.inletModelObjects(); |
| 681 | |||
| 682 | 240 | auto it2 = mixerInletObjects.begin(); | |
| 683 | 240 | unsigned i = 0; | |
| 684 |
2/2✓ Branch 5 taken 256 times.
✓ Branch 6 taken 240 times.
|
496 | for (auto& splitterOutletObject : splitterOutletObjects) { |
| 685 | 256 | i++; | |
| 686 | |||
| 687 |
1/1✓ Branch 1 taken 256 times.
|
256 | std::stringstream ss; |
| 688 |
1/1✓ Branch 1 taken 256 times.
|
256 | ss << i; |
| 689 |
1/1✓ Branch 1 taken 256 times.
|
256 | std::string istring = ss.str(); |
| 690 | |||
| 691 |
3/3✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
✓ Branch 7 taken 256 times.
|
256 | model::HVACComponent comp1 = splitterOutletObject.optionalCast<model::HVACComponent>().get(); |
| 692 |
3/3✓ Branch 2 taken 256 times.
✓ Branch 5 taken 256 times.
✓ Branch 8 taken 256 times.
|
256 | model::HVACComponent comp2 = it2->optionalCast<model::HVACComponent>().get(); |
| 693 | |||
| 694 |
3/3✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
✓ Branch 7 taken 256 times.
|
512 | std::vector<model::ModelObject> allComponents = plantLoop.supplyComponents(comp1, comp2); |
| 695 | |||
| 696 |
2/2✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
|
256 | IdfObject _equipmentBranch(IddObjectType::Branch); |
| 697 |
1/1✓ Branch 1 taken 256 times.
|
256 | _equipmentBranch.clearExtensibleGroups(); |
| 698 |
5/5✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
✓ Branch 7 taken 256 times.
✓ Branch 10 taken 256 times.
✓ Branch 13 taken 256 times.
|
256 | _equipmentBranch.setName(plantLoop.name().get() + " Supply Branch " + istring); |
| 699 |
1/1✓ Branch 1 taken 256 times.
|
256 | m_idfObjects.push_back(_equipmentBranch); |
| 700 | |||
| 701 |
1/1✓ Branch 1 taken 256 times.
|
256 | eg = _supplySplitter.pushExtensibleGroup(); |
| 702 |
3/3✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
✓ Branch 7 taken 256 times.
|
256 | eg.setString(Connector_SplitterExtensibleFields::OutletBranchName, _equipmentBranch.name().get()); |
| 703 | |||
| 704 |
1/1✓ Branch 1 taken 256 times.
|
256 | eg = _supplyMixer.pushExtensibleGroup(); |
| 705 |
3/3✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
✓ Branch 7 taken 256 times.
|
256 | eg.setString(Connector_MixerExtensibleFields::InletBranchName, _equipmentBranch.name().get()); |
| 706 | |||
| 707 |
1/1✓ Branch 1 taken 256 times.
|
256 | eg = _supplyBranchList.pushExtensibleGroup(); |
| 708 |
3/3✓ Branch 1 taken 256 times.
✓ Branch 4 taken 256 times.
✓ Branch 7 taken 256 times.
|
256 | eg.setString(BranchListExtensibleFields::BranchName, _equipmentBranch.name().get()); |
| 709 | |||
| 710 |
2/2✓ Branch 1 taken 102 times.
✓ Branch 2 taken 154 times.
|
256 | if (allComponents.size() > 2u) { |
| 711 |
1/1✓ Branch 1 taken 102 times.
|
102 | populateBranch(_equipmentBranch, allComponents, plantLoop, true); |
| 712 | } else { | ||
| 713 |
2/2✓ Branch 1 taken 154 times.
✓ Branch 4 taken 154 times.
|
154 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 714 |
6/6✓ Branch 1 taken 154 times.
✓ Branch 4 taken 154 times.
✓ Branch 7 taken 154 times.
✓ Branch 10 taken 154 times.
✓ Branch 13 taken 154 times.
✓ Branch 16 taken 154 times.
|
154 | pipe.setName(plantLoop.name().get() + " Supply Branch " + istring + " Pipe"); |
| 715 |
1/1✓ Branch 1 taken 154 times.
|
154 | m_idfObjects.push_back(pipe); |
| 716 | |||
| 717 |
3/3✓ Branch 1 taken 154 times.
✓ Branch 4 taken 154 times.
✓ Branch 7 taken 154 times.
|
154 | std::string inletNodeName = pipe.name().get() + " Inlet Node"; |
| 718 |
3/3✓ Branch 1 taken 154 times.
✓ Branch 4 taken 154 times.
✓ Branch 7 taken 154 times.
|
154 | std::string outletNodeName = pipe.name().get() + " Outlet Node"; |
| 719 | |||
| 720 |
1/1✓ Branch 1 taken 154 times.
|
154 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 721 |
1/1✓ Branch 1 taken 154 times.
|
154 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 722 | |||
| 723 |
1/1✓ Branch 1 taken 154 times.
|
154 | IdfExtensibleGroup eg = _equipmentBranch.pushExtensibleGroup(); |
| 724 |
3/3✓ Branch 1 taken 154 times.
✓ Branch 4 taken 154 times.
✓ Branch 7 taken 154 times.
|
154 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 725 |
3/3✓ Branch 1 taken 154 times.
✓ Branch 4 taken 154 times.
✓ Branch 7 taken 154 times.
|
154 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 726 |
1/1✓ Branch 1 taken 154 times.
|
154 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 727 |
1/1✓ Branch 1 taken 154 times.
|
154 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 728 | 154 | } | |
| 729 | |||
| 730 | 256 | ++it2; | |
| 731 | 256 | } | |
| 732 | |||
| 733 | // Populate supply outlet branch | ||
| 734 | |||
| 735 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _supplyOutletBranch(IddObjectType::Branch); |
| 736 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _supplyOutletBranch.setName(plantLoop.name().get() + " Supply Outlet Branch"); |
| 737 |
1/1✓ Branch 1 taken 240 times.
|
240 | _supplyOutletBranch.clearExtensibleGroups(); |
| 738 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg = _supplyBranchList.pushExtensibleGroup(); |
| 739 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchListExtensibleFields::BranchName, _supplyOutletBranch.name().get()); |
| 740 | |||
| 741 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | _supplyMixer.setString(Connector_MixerFields::OutletBranchName, _supplyOutletBranch.name().get()); |
| 742 | |||
| 743 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_supplyOutletBranch); |
| 744 | |||
| 745 | 240 | std::vector<ModelObject> supplyOutletModelObjects; | |
| 746 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
480 | supplyOutletModelObjects = plantLoop.supplyComponents(supplyMixer, supplyOutletNode); |
| 747 | |||
| 748 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✗ Branch 4 not taken.
|
240 | OS_ASSERT(supplyOutletModelObjects.size() >= 2); |
| 749 | |||
| 750 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 2 taken 234 times.
|
240 | if (supplyOutletModelObjects.size() > 2u) { |
| 751 |
1/1✓ Branch 1 taken 6 times.
|
6 | populateBranch(_supplyOutletBranch, supplyOutletModelObjects, plantLoop, true); |
| 752 | } else { | ||
| 753 |
2/2✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
|
234 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 754 |
4/4✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
✓ Branch 7 taken 234 times.
✓ Branch 10 taken 234 times.
|
234 | pipe.setName(plantLoop.name().get() + " Supply Outlet Pipe"); |
| 755 |
1/1✓ Branch 1 taken 234 times.
|
234 | m_idfObjects.push_back(pipe); |
| 756 | |||
| 757 |
3/3✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
✓ Branch 7 taken 234 times.
|
234 | std::string inletNodeName = plantLoop.name().get() + " Supply Outlet Pipe Node"; |
| 758 |
4/4✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
✓ Branch 7 taken 234 times.
✓ Branch 10 taken 234 times.
|
234 | std::string outletNodeName = plantLoop.supplyOutletNode().name().get(); |
| 759 | |||
| 760 |
1/1✓ Branch 1 taken 234 times.
|
234 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 761 |
1/1✓ Branch 1 taken 234 times.
|
234 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 762 | |||
| 763 |
1/1✓ Branch 1 taken 234 times.
|
234 | IdfExtensibleGroup eg = _supplyOutletBranch.pushExtensibleGroup(); |
| 764 |
3/3✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
✓ Branch 7 taken 234 times.
|
234 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 765 |
3/3✓ Branch 1 taken 234 times.
✓ Branch 4 taken 234 times.
✓ Branch 7 taken 234 times.
|
234 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 766 |
1/1✓ Branch 1 taken 234 times.
|
234 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 767 |
1/1✓ Branch 1 taken 234 times.
|
234 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 768 | 234 | } | |
| 769 | |||
| 770 | // Demand Side | ||
| 771 | |||
| 772 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _demandBranchList(IddObjectType::BranchList); |
| 773 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _demandBranchList.setName(plantLoop.name().get() + " Demand Branches"); |
| 774 |
1/1✓ Branch 1 taken 240 times.
|
240 | _demandBranchList.clearExtensibleGroups(); |
| 775 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_demandBranchList); |
| 776 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::DemandSideBranchListName, _demandBranchList.name().get()); |
| 777 | |||
| 778 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _demandConnectorList(IddObjectType::ConnectorList); |
| 779 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _demandConnectorList.setName(plantLoop.name().get() + " Demand Connector List"); |
| 780 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_demandConnectorList); |
| 781 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::DemandSideConnectorListName, _demandConnectorList.name().get()); |
| 782 | |||
| 783 |
1/1✓ Branch 1 taken 240 times.
|
240 | Splitter demandSplitter = plantLoop.demandSplitter(); |
| 784 |
1/1✓ Branch 1 taken 240 times.
|
240 | Mixer demandMixer = plantLoop.demandMixer(); |
| 785 | |||
| 786 |
1/1✓ Branch 1 taken 240 times.
|
240 | Node demandInletNode = plantLoop.demandInletNode(); |
| 787 |
1/1✓ Branch 1 taken 240 times.
|
240 | Node demandOutletNode = plantLoop.demandOutletNode(); |
| 788 | |||
| 789 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _demandSplitter(IddObjectType::Connector_Splitter); |
| 790 |
1/1✓ Branch 1 taken 240 times.
|
240 | _demandSplitter.clearExtensibleGroups(); |
| 791 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _demandSplitter.setName(plantLoop.name().get() + " Demand Splitter"); |
| 792 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_demandSplitter); |
| 793 |
1/1✓ Branch 1 taken 240 times.
|
240 | ExtensibleIndex ei(0, 0); |
| 794 | 240 | ei.group = 0; | |
| 795 | 240 | ei.field = ConnectorListExtensibleFields::ConnectorObjectType; | |
| 796 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _demandConnectorList.setString(_demandConnectorList.iddObject().index(ei), _demandSplitter.iddObject().name()); |
| 797 | 240 | ei.field = ConnectorListExtensibleFields::ConnectorName; | |
| 798 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _demandConnectorList.setString(_demandConnectorList.iddObject().index(ei), _demandSplitter.name().get()); |
| 799 | |||
| 800 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _demandMixer(IddObjectType::Connector_Mixer); |
| 801 |
1/1✓ Branch 1 taken 240 times.
|
240 | _demandMixer.clearExtensibleGroups(); |
| 802 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _demandMixer.setName(plantLoop.name().get() + " Demand Mixer"); |
| 803 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_demandMixer); |
| 804 | 240 | ei.group = 1; | |
| 805 | 240 | ei.field = ConnectorListExtensibleFields::ConnectorObjectType; | |
| 806 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _demandConnectorList.setString(_demandConnectorList.iddObject().index(ei), _demandMixer.iddObject().name()); |
| 807 | 240 | ei.field = ConnectorListExtensibleFields::ConnectorName; | |
| 808 |
5/5✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
✓ Branch 13 taken 240 times.
|
240 | _demandConnectorList.setString(_demandConnectorList.iddObject().index(ei), _demandMixer.name().get()); |
| 809 | |||
| 810 | // Demand inlet branch | ||
| 811 | |||
| 812 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _demandInletBranch(IddObjectType::Branch); |
| 813 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _demandInletBranch.setName(plantLoop.name().get() + " Demand Inlet Branch"); |
| 814 |
1/1✓ Branch 1 taken 240 times.
|
240 | _demandInletBranch.clearExtensibleGroups(); |
| 815 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg = _demandBranchList.pushExtensibleGroup(); |
| 816 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchListExtensibleFields::BranchName, _demandInletBranch.name().get()); |
| 817 | |||
| 818 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | _demandSplitter.setString(Connector_SplitterFields::InletBranchName, _demandInletBranch.name().get()); |
| 819 | |||
| 820 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_demandInletBranch); |
| 821 | |||
| 822 | 240 | std::vector<ModelObject> demandInletModelObjects; | |
| 823 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
480 | demandInletModelObjects = plantLoop.demandComponents(demandInletNode, demandSplitter); |
| 824 | |||
| 825 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✗ Branch 4 not taken.
|
240 | OS_ASSERT(demandInletModelObjects.size() >= 2u); |
| 826 | |||
| 827 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
|
240 | if (demandInletModelObjects.size() > 2u) { |
| 828 | ✗ | populateBranch(_demandInletBranch, demandInletModelObjects, plantLoop, false); | |
| 829 | } else { | ||
| 830 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 831 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | pipe.setName(plantLoop.name().get() + " Demand Inlet Pipe"); |
| 832 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(pipe); |
| 833 | |||
| 834 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | std::string inletNodeName = plantLoop.demandInletNode().name().get(); |
| 835 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | std::string outletNodeName = plantLoop.name().get() + " Demand Inlet Pipe Node"; |
| 836 | |||
| 837 |
1/1✓ Branch 1 taken 240 times.
|
240 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 838 |
1/1✓ Branch 1 taken 240 times.
|
240 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 839 | |||
| 840 |
1/1✓ Branch 1 taken 240 times.
|
240 | IdfExtensibleGroup eg = _demandInletBranch.pushExtensibleGroup(); |
| 841 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 842 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 843 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 844 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 845 | 240 | } | |
| 846 | |||
| 847 | // Populate equipment branches | ||
| 848 | |||
| 849 |
1/1✓ Branch 1 taken 240 times.
|
240 | splitterOutletObjects = demandSplitter.outletModelObjects(); |
| 850 |
1/1✓ Branch 1 taken 240 times.
|
240 | mixerInletObjects = demandMixer.inletModelObjects(); |
| 851 | |||
| 852 | 240 | it2 = mixerInletObjects.begin(); | |
| 853 | 240 | i = 0; | |
| 854 |
2/2✓ Branch 5 taken 243 times.
✓ Branch 6 taken 240 times.
|
483 | for (auto& splitterOutletObject : splitterOutletObjects) { |
| 855 | 243 | i++; | |
| 856 | |||
| 857 |
1/1✓ Branch 1 taken 243 times.
|
243 | std::stringstream ss; |
| 858 |
1/1✓ Branch 1 taken 243 times.
|
243 | ss << i; |
| 859 |
1/1✓ Branch 1 taken 243 times.
|
243 | std::string istring = ss.str(); |
| 860 | |||
| 861 |
3/3✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
✓ Branch 7 taken 243 times.
|
243 | model::HVACComponent comp1 = splitterOutletObject.optionalCast<model::HVACComponent>().get(); |
| 862 |
3/3✓ Branch 2 taken 243 times.
✓ Branch 5 taken 243 times.
✓ Branch 8 taken 243 times.
|
243 | model::HVACComponent comp2 = it2->optionalCast<model::HVACComponent>().get(); |
| 863 | |||
| 864 |
3/3✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
✓ Branch 7 taken 243 times.
|
486 | std::vector<model::ModelObject> allComponents = plantLoop.demandComponents(comp1, comp2); |
| 865 | |||
| 866 |
2/2✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
|
243 | IdfObject _equipmentBranch(IddObjectType::Branch); |
| 867 |
1/1✓ Branch 1 taken 243 times.
|
243 | _equipmentBranch.clearExtensibleGroups(); |
| 868 |
5/5✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
✓ Branch 7 taken 243 times.
✓ Branch 10 taken 243 times.
✓ Branch 13 taken 243 times.
|
243 | _equipmentBranch.setName(plantLoop.name().get() + " Demand Branch " + istring); |
| 869 |
1/1✓ Branch 1 taken 243 times.
|
243 | m_idfObjects.push_back(_equipmentBranch); |
| 870 | |||
| 871 |
1/1✓ Branch 1 taken 243 times.
|
243 | eg = _demandSplitter.pushExtensibleGroup(); |
| 872 |
3/3✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
✓ Branch 7 taken 243 times.
|
243 | eg.setString(Connector_SplitterExtensibleFields::OutletBranchName, _equipmentBranch.name().get()); |
| 873 | |||
| 874 |
1/1✓ Branch 1 taken 243 times.
|
243 | eg = _demandMixer.pushExtensibleGroup(); |
| 875 |
3/3✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
✓ Branch 7 taken 243 times.
|
243 | eg.setString(Connector_MixerExtensibleFields::InletBranchName, _equipmentBranch.name().get()); |
| 876 | |||
| 877 |
1/1✓ Branch 1 taken 243 times.
|
243 | eg = _demandBranchList.pushExtensibleGroup(); |
| 878 |
3/3✓ Branch 1 taken 243 times.
✓ Branch 4 taken 243 times.
✓ Branch 7 taken 243 times.
|
243 | eg.setString(BranchListExtensibleFields::BranchName, _equipmentBranch.name().get()); |
| 879 | |||
| 880 |
2/2✓ Branch 1 taken 83 times.
✓ Branch 2 taken 160 times.
|
243 | if (allComponents.size() > 2u) { |
| 881 |
1/1✓ Branch 1 taken 83 times.
|
83 | populateBranch(_equipmentBranch, allComponents, plantLoop, false); |
| 882 | } else { | ||
| 883 |
2/2✓ Branch 1 taken 160 times.
✓ Branch 4 taken 160 times.
|
160 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 884 |
6/6✓ Branch 1 taken 160 times.
✓ Branch 4 taken 160 times.
✓ Branch 7 taken 160 times.
✓ Branch 10 taken 160 times.
✓ Branch 13 taken 160 times.
✓ Branch 16 taken 160 times.
|
160 | pipe.setName(plantLoop.name().get() + " Demand Branch " + istring + " Pipe"); |
| 885 |
1/1✓ Branch 1 taken 160 times.
|
160 | m_idfObjects.push_back(pipe); |
| 886 | |||
| 887 |
3/3✓ Branch 1 taken 160 times.
✓ Branch 4 taken 160 times.
✓ Branch 7 taken 160 times.
|
160 | std::string inletNodeName = pipe.name().get() + " Inlet Node"; |
| 888 |
3/3✓ Branch 1 taken 160 times.
✓ Branch 4 taken 160 times.
✓ Branch 7 taken 160 times.
|
160 | std::string outletNodeName = pipe.name().get() + " Outlet Node"; |
| 889 | |||
| 890 |
1/1✓ Branch 1 taken 160 times.
|
160 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 891 |
1/1✓ Branch 1 taken 160 times.
|
160 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 892 | |||
| 893 |
1/1✓ Branch 1 taken 160 times.
|
160 | IdfExtensibleGroup eg = _equipmentBranch.pushExtensibleGroup(); |
| 894 |
3/3✓ Branch 1 taken 160 times.
✓ Branch 4 taken 160 times.
✓ Branch 7 taken 160 times.
|
160 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 895 |
3/3✓ Branch 1 taken 160 times.
✓ Branch 4 taken 160 times.
✓ Branch 7 taken 160 times.
|
160 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 896 |
1/1✓ Branch 1 taken 160 times.
|
160 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 897 |
1/1✓ Branch 1 taken 160 times.
|
160 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 898 | 160 | } | |
| 899 | |||
| 900 | 243 | ++it2; | |
| 901 | 243 | } | |
| 902 | |||
| 903 | // Install a bypass branch with a pipe | ||
| 904 | |||
| 905 |
1/2✓ Branch 1 taken 240 times.
✗ Branch 2 not taken.
|
240 | if (!splitterOutletObjects.empty()) { |
| 906 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _equipmentBranch(IddObjectType::Branch); |
| 907 |
1/1✓ Branch 1 taken 240 times.
|
240 | _equipmentBranch.clearExtensibleGroups(); |
| 908 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _equipmentBranch.setName(plantLoop.name().get() + " Demand Bypass Branch"); |
| 909 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_equipmentBranch); |
| 910 | |||
| 911 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg = _demandSplitter.pushExtensibleGroup(); |
| 912 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(Connector_SplitterExtensibleFields::OutletBranchName, _equipmentBranch.name().get()); |
| 913 | |||
| 914 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg = _demandMixer.pushExtensibleGroup(); |
| 915 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(Connector_MixerExtensibleFields::InletBranchName, _equipmentBranch.name().get()); |
| 916 | |||
| 917 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg = _demandBranchList.pushExtensibleGroup(); |
| 918 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchListExtensibleFields::BranchName, _equipmentBranch.name().get()); |
| 919 | |||
| 920 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 921 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | pipe.setName(plantLoop.name().get() + " Demand Bypass Pipe"); |
| 922 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(pipe); |
| 923 | |||
| 924 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | std::string inletNodeName = pipe.name().get() + " Inlet Node"; |
| 925 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | std::string outletNodeName = pipe.name().get() + " Outlet Node"; |
| 926 | |||
| 927 |
1/1✓ Branch 1 taken 240 times.
|
240 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 928 |
1/1✓ Branch 1 taken 240 times.
|
240 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 929 | |||
| 930 |
1/1✓ Branch 1 taken 240 times.
|
240 | IdfExtensibleGroup eg = _equipmentBranch.pushExtensibleGroup(); |
| 931 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 932 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 933 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 934 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 935 | 240 | } | |
| 936 | |||
| 937 | // Populate demand outlet branch | ||
| 938 | |||
| 939 |
2/2✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
|
240 | IdfObject _demandOutletBranch(IddObjectType::Branch); |
| 940 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | _demandOutletBranch.setName(plantLoop.name().get() + " Demand Outlet Branch"); |
| 941 |
1/1✓ Branch 1 taken 240 times.
|
240 | _demandOutletBranch.clearExtensibleGroups(); |
| 942 |
1/1✓ Branch 1 taken 240 times.
|
240 | eg = _demandBranchList.pushExtensibleGroup(); |
| 943 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | eg.setString(BranchListExtensibleFields::BranchName, _demandOutletBranch.name().get()); |
| 944 | |||
| 945 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
240 | _demandMixer.setString(Connector_MixerFields::OutletBranchName, _demandOutletBranch.name().get()); |
| 946 | |||
| 947 |
1/1✓ Branch 1 taken 240 times.
|
240 | m_idfObjects.push_back(_demandOutletBranch); |
| 948 | |||
| 949 | 240 | std::vector<ModelObject> demandOutletModelObjects; | |
| 950 |
3/3✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
|
480 | demandOutletModelObjects = plantLoop.demandComponents(demandMixer, demandOutletNode); |
| 951 | |||
| 952 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✗ Branch 4 not taken.
|
240 | OS_ASSERT(demandOutletModelObjects.size() >= 2u); |
| 953 | |||
| 954 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 239 times.
|
240 | if (demandOutletModelObjects.size() > 2u) { |
| 955 |
1/1✓ Branch 1 taken 1 time.
|
1 | populateBranch(_demandOutletBranch, demandOutletModelObjects, plantLoop, false); |
| 956 | } else { | ||
| 957 |
2/2✓ Branch 1 taken 239 times.
✓ Branch 4 taken 239 times.
|
239 | IdfObject pipe(IddObjectType::Pipe_Adiabatic); |
| 958 |
4/4✓ Branch 1 taken 239 times.
✓ Branch 4 taken 239 times.
✓ Branch 7 taken 239 times.
✓ Branch 10 taken 239 times.
|
239 | pipe.setName(plantLoop.name().get() + " Demand Outlet Pipe"); |
| 959 |
1/1✓ Branch 1 taken 239 times.
|
239 | m_idfObjects.push_back(pipe); |
| 960 | |||
| 961 |
3/3✓ Branch 1 taken 239 times.
✓ Branch 4 taken 239 times.
✓ Branch 7 taken 239 times.
|
239 | std::string inletNodeName = plantLoop.name().get() + " Demand Outlet Pipe Node"; |
| 962 |
4/4✓ Branch 1 taken 239 times.
✓ Branch 4 taken 239 times.
✓ Branch 7 taken 239 times.
✓ Branch 10 taken 239 times.
|
239 | std::string outletNodeName = plantLoop.demandOutletNode().name().get(); |
| 963 | |||
| 964 |
1/1✓ Branch 1 taken 239 times.
|
239 | pipe.setString(Pipe_AdiabaticFields::InletNodeName, inletNodeName); |
| 965 |
1/1✓ Branch 1 taken 239 times.
|
239 | pipe.setString(Pipe_AdiabaticFields::OutletNodeName, outletNodeName); |
| 966 | |||
| 967 |
1/1✓ Branch 1 taken 239 times.
|
239 | IdfExtensibleGroup eg = _demandOutletBranch.pushExtensibleGroup(); |
| 968 |
3/3✓ Branch 1 taken 239 times.
✓ Branch 4 taken 239 times.
✓ Branch 7 taken 239 times.
|
239 | eg.setString(BranchExtensibleFields::ComponentObjectType, pipe.iddObject().name()); |
| 969 |
3/3✓ Branch 1 taken 239 times.
✓ Branch 4 taken 239 times.
✓ Branch 7 taken 239 times.
|
239 | eg.setString(BranchExtensibleFields::ComponentName, pipe.name().get()); |
| 970 |
1/1✓ Branch 1 taken 239 times.
|
239 | eg.setString(BranchExtensibleFields::ComponentInletNodeName, inletNodeName); |
| 971 |
1/1✓ Branch 1 taken 239 times.
|
239 | eg.setString(BranchExtensibleFields::ComponentOutletNodeName, outletNodeName); |
| 972 | 239 | } | |
| 973 | |||
| 974 | // Operation Scheme | ||
| 975 | // auto opSchemeStart = m_idfObjects.end(); | ||
| 976 |
1/1✓ Branch 1 taken 240 times.
|
240 | const auto& operationSchemes = translatePlantEquipmentOperationSchemes(plantLoop); |
| 977 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 240 times.
✗ Branch 4 not taken.
|
240 | OS_ASSERT(operationSchemes); |
| 978 |
4/4✓ Branch 1 taken 240 times.
✓ Branch 4 taken 240 times.
✓ Branch 7 taken 240 times.
✓ Branch 10 taken 240 times.
|
240 | idfObject.setString(PlantLoopFields::PlantEquipmentOperationSchemeName, operationSchemes->name().get()); |
| 979 | // auto opSchemeEnd = m_idfObjects.end(); | ||
| 980 | |||
| 981 | //std::vector<IdfObject> opSchemeObjects(opSchemeStart,opSchemeEnd); | ||
| 982 | //m_idfObjects.erase(opSchemeStart,opSchemeEnd); | ||
| 983 | //m_idfObjects.insert(m_idfObjects.begin() + operationSchemeLocation,opSchemeObjects.begin(),opSchemeObjects.end()); | ||
| 984 | |||
| 985 |
1/1✓ Branch 1 taken 240 times.
|
480 | return boost::optional<IdfObject>(idfObject); |
| 986 | 240 | } | |
| 987 | |||
| 988 | } // namespace energyplus | ||
| 989 | |||
| 990 | } // namespace openstudio | ||
| 991 |