src/energyplus/ForwardTranslator/ForwardTranslatePipeIndoor.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/PipeIndoor.hpp" | ||
| 10 | #include "../../model/PipeIndoor_Impl.hpp" | ||
| 11 | #include "../../model/Schedule.hpp" | ||
| 12 | #include "../../model/Schedule_Impl.hpp" | ||
| 13 | #include "../../model/ThermalZone.hpp" | ||
| 14 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 15 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | #include <utilities/idd/Pipe_Indoor_FieldEnums.hxx> | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | ✗ | boost::optional<IdfObject> ForwardTranslator::translatePipeIndoor(PipeIndoor& modelObject) { | |
| 26 | |||
| 27 | ✗ | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Pipe_Indoor, modelObject); | |
| 28 | |||
| 29 | ✗ | if (auto node_ = modelObject.inletModelObject()) { | |
| 30 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::FluidInletNodeName, node_->nameString()); | |
| 31 | ✗ | } | |
| 32 | |||
| 33 | ✗ | if (auto node_ = modelObject.outletModelObject()) { | |
| 34 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::FluidOutletNodeName, node_->nameString()); | |
| 35 | ✗ | } | |
| 36 | |||
| 37 | ✗ | if (auto construction_ = modelObject.construction()) { | |
| 38 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::ConstructionName, construction_->nameString()); | |
| 39 | ✗ | } | |
| 40 | |||
| 41 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::EnvironmentType, modelObject.environmentType()); | |
| 42 | |||
| 43 | ✗ | if (auto zone_ = modelObject.ambientTemperatureZone()) { | |
| 44 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::AmbientTemperatureZoneName, zone_->nameString()); | |
| 45 | ✗ | } | |
| 46 | |||
| 47 | ✗ | if (auto schedule_ = modelObject.ambientTemperatureSchedule()) { | |
| 48 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::AmbientTemperatureScheduleName, schedule_->nameString()); | |
| 49 | ✗ | } | |
| 50 | |||
| 51 | ✗ | if (auto schedule_ = modelObject.ambientAirVelocitySchedule()) { | |
| 52 | ✗ | idfObject.setString(openstudio::Pipe_IndoorFields::AmbientAirVelocityScheduleName, schedule_->nameString()); | |
| 53 | ✗ | } | |
| 54 | |||
| 55 | ✗ | idfObject.setDouble(openstudio::Pipe_IndoorFields::PipeInsideDiameter, modelObject.pipeInsideDiameter()); | |
| 56 | |||
| 57 | ✗ | idfObject.setDouble(openstudio::Pipe_IndoorFields::PipeLength, modelObject.pipeLength()); | |
| 58 | |||
| 59 | ✗ | return idfObject; | |
| 60 | ✗ | } | |
| 61 | |||
| 62 | } // namespace energyplus | ||
| 63 | |||
| 64 | } // namespace openstudio | ||
| 65 |