src/energyplus/ForwardTranslator/CreateAirLoopHVACSupplyPath.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 | #include "../../model/Model.hpp" | ||
| 8 | #include "../../model/AirLoopHVAC.hpp" | ||
| 9 | #include "../../model/AirLoopHVAC_Impl.hpp" | ||
| 10 | #include "../../model/Node.hpp" | ||
| 11 | #include "../../model/Node_Impl.hpp" | ||
| 12 | #include "../../model/AirLoopHVACZoneSplitter.hpp" | ||
| 13 | #include "../../model/AirLoopHVACZoneSplitter_Impl.hpp" | ||
| 14 | #include "../../model/AirLoopHVACSupplyPlenum.hpp" | ||
| 15 | #include "../../model/AirLoopHVACSupplyPlenum_Impl.hpp" | ||
| 16 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 17 | #include "../../utilities/idf/Workspace.hpp" | ||
| 18 | #include "../../utilities/idf/WorkspaceObjectOrder.hpp" | ||
| 19 | #include "../../utilities/core/Logger.hpp" | ||
| 20 | #include "../../utilities/core/Assert.hpp" | ||
| 21 | #include <utilities/idd/AirLoopHVAC_SupplyPath_FieldEnums.hxx> | ||
| 22 | #include <utilities/idd/IddEnums.hxx> | ||
| 23 | |||
| 24 | using namespace openstudio::model; | ||
| 25 | |||
| 26 | using namespace std; | ||
| 27 | |||
| 28 | namespace openstudio { | ||
| 29 | |||
| 30 | namespace energyplus { | ||
| 31 | |||
| 32 | 205 | boost::optional<IdfObject> ForwardTranslator::createAirLoopHVACSupplyPath(const Node& demandInletNode) { | |
| 33 | 205 | boost::optional<IdfObject> supplyPathIdf; | |
| 34 | |||
| 35 |
2/3✓ Branch 1 taken 205 times.
✓ Branch 3 taken 205 times.
✗ Branch 4 not taken.
|
410 | if (auto t_airLoopHVAC = demandInletNode.airLoopHVAC()) { |
| 36 |
2/2✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
|
205 | IdfObject supplyPathIdf(openstudio::IddObjectType::AirLoopHVAC_SupplyPath); |
| 37 |
1/1✓ Branch 1 taken 205 times.
|
205 | m_idfObjects.push_back(supplyPathIdf); |
| 38 | |||
| 39 |
9/9✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
✓ Branch 7 taken 205 times.
✓ Branch 10 taken 205 times.
✓ Branch 13 taken 205 times.
✓ Branch 16 taken 205 times.
✓ Branch 19 taken 205 times.
✓ Branch 22 taken 205 times.
✓ Branch 25 taken 205 times.
|
205 | supplyPathIdf.setName(t_airLoopHVAC->name().get() + " " + demandInletNode.name().get() + " Supply Path"); |
| 40 | |||
| 41 |
3/3✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
✓ Branch 7 taken 205 times.
|
205 | supplyPathIdf.setString(openstudio::AirLoopHVAC_SupplyPathFields::SupplyAirPathInletNodeName, demandInletNode.name().get()); |
| 42 | |||
| 43 |
6/6✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
✓ Branch 7 taken 205 times.
✓ Branch 10 taken 205 times.
✓ Branch 13 taken 205 times.
✓ Branch 16 taken 205 times.
|
410 | auto t_comps = t_airLoopHVAC->demandComponents(demandInletNode, t_airLoopHVAC->demandOutletNode()); |
| 44 |
1/1✓ Branch 1 taken 205 times.
|
205 | auto splitters = subsetCastVector<model::AirLoopHVACZoneSplitter>(t_comps); |
| 45 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 205 times.
✗ Branch 4 not taken.
|
205 | OS_ASSERT(splitters.size() == 1u); |
| 46 | |||
| 47 |
1/1✓ Branch 2 taken 205 times.
|
205 | boost::optional<IdfObject> _zoneSplitter = translateAndMapModelObject(splitters.front()); |
| 48 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 205 times.
✗ Branch 4 not taken.
|
205 | OS_ASSERT(_zoneSplitter); |
| 49 |
1/1✓ Branch 1 taken 205 times.
|
205 | IdfExtensibleGroup eg = supplyPathIdf.pushExtensibleGroup(); |
| 50 |
4/4✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
✓ Branch 7 taken 205 times.
✓ Branch 10 taken 205 times.
|
205 | eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentObjectType, _zoneSplitter->iddObject().name()); |
| 51 |
4/4✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
✓ Branch 7 taken 205 times.
✓ Branch 10 taken 205 times.
|
205 | eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentName, _zoneSplitter->name().get()); |
| 52 | |||
| 53 | std::vector<ModelObject> supplyPlenums = | ||
| 54 |
5/5✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
✓ Branch 7 taken 205 times.
✓ Branch 10 taken 205 times.
✓ Branch 13 taken 205 times.
|
205 | t_airLoopHVAC->demandComponents(demandInletNode, t_airLoopHVAC->demandOutletNode(), AirLoopHVACSupplyPlenum::iddObjectType()); |
| 55 |
1/2✗ Branch 5 not taken.
✓ Branch 6 taken 205 times.
|
205 | for (auto& supplyPlenum : supplyPlenums) { |
| 56 | ✗ | eg = supplyPathIdf.pushExtensibleGroup(); | |
| 57 | ✗ | boost::optional<IdfObject> _supplyPlenum = translateAndMapModelObject(supplyPlenum); | |
| 58 | ✗ | OS_ASSERT(_supplyPlenum); | |
| 59 | ✗ | eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentObjectType, _supplyPlenum->iddObject().name()); | |
| 60 | ✗ | eg.setString(AirLoopHVAC_SupplyPathExtensibleFields::ComponentName, _supplyPlenum->name().get()); | |
| 61 | ✗ | } | |
| 62 | 410 | } | |
| 63 | |||
| 64 | 205 | return supplyPathIdf; | |
| 65 | ✗ | } | |
| 66 | |||
| 67 | } // namespace energyplus | ||
| 68 | |||
| 69 | } // namespace openstudio | ||
| 70 |