src/energyplus/ForwardTranslator/ForwardTranslatePipeOutdoor.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/Construction.hpp" | ||
| 8 | #include "../../model/Construction_Impl.hpp" | ||
| 9 | #include "../../model/Node.hpp" | ||
| 10 | #include "../../model/Node_Impl.hpp" | ||
| 11 | #include "../../model/PipeOutdoor.hpp" | ||
| 12 | #include "../../model/PipeOutdoor_Impl.hpp" | ||
| 13 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | #include <utilities/idd/Pipe_Outdoor_FieldEnums.hxx> | ||
| 16 | |||
| 17 | using namespace openstudio::model; | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | |||
| 21 | namespace energyplus { | ||
| 22 | |||
| 23 | ✗ | boost::optional<IdfObject> ForwardTranslator::translatePipeOutdoor(PipeOutdoor& modelObject) { | |
| 24 | ✗ | IdfObject idfObject(openstudio::IddObjectType::Pipe_Outdoor); | |
| 25 | |||
| 26 | ✗ | m_idfObjects.push_back(idfObject); | |
| 27 | |||
| 28 | ✗ | if (auto node = modelObject.inletModelObject()) { | |
| 29 | ✗ | idfObject.setString(openstudio::Pipe_OutdoorFields::FluidInletNodeName, node->name().get()); | |
| 30 | ✗ | } | |
| 31 | |||
| 32 | ✗ | if (auto node = modelObject.outletModelObject()) { | |
| 33 | ✗ | idfObject.setString(openstudio::Pipe_OutdoorFields::FluidOutletNodeName, node->name().get()); | |
| 34 | ✗ | } | |
| 35 | |||
| 36 | ✗ | if (auto value = modelObject.name()) { | |
| 37 | ✗ | idfObject.setName(value.get()); | |
| 38 | ✗ | } | |
| 39 | |||
| 40 | ✗ | if (auto construction = modelObject.construction()) { | |
| 41 | ✗ | idfObject.setString(openstudio::Pipe_OutdoorFields::ConstructionName, construction->name().get()); | |
| 42 | ✗ | } | |
| 43 | |||
| 44 | ✗ | if (auto node = modelObject.ambientTemperatureOutdoorAirNode()) { | |
| 45 | ✗ | idfObject.setString(openstudio::Pipe_OutdoorFields::AmbientTemperatureOutdoorAirNodeName, node->name().get()); | |
| 46 | } else { | ||
| 47 | ✗ | auto name = modelObject.name().get() + " OA Node"; | |
| 48 | ✗ | IdfObject oaNodeListIdf(openstudio::IddObjectType::OutdoorAir_NodeList); | |
| 49 | ✗ | oaNodeListIdf.setString(0, name); | |
| 50 | ✗ | m_idfObjects.push_back(oaNodeListIdf); | |
| 51 | |||
| 52 | ✗ | idfObject.setString(openstudio::Pipe_OutdoorFields::AmbientTemperatureOutdoorAirNodeName, name); | |
| 53 | ✗ | } | |
| 54 | |||
| 55 | ✗ | idfObject.setDouble(openstudio::Pipe_OutdoorFields::PipeInsideDiameter, modelObject.pipeInsideDiameter()); | |
| 56 | |||
| 57 | ✗ | idfObject.setDouble(openstudio::Pipe_OutdoorFields::PipeLength, modelObject.pipeLength()); | |
| 58 | |||
| 59 | ✗ | return idfObject; | |
| 60 | ✗ | } | |
| 61 | |||
| 62 | } // namespace energyplus | ||
| 63 | |||
| 64 | } // namespace openstudio | ||
| 65 |