src/energyplus/ForwardTranslator/ForwardTranslateRoofVegetation.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/RoofVegetation.hpp" | ||
| 8 | #include <utilities/idd/OS_Material_RoofVegetation_FieldEnums.hxx> | ||
| 9 | |||
| 10 | #include <utilities/idd/Material_RoofVegetation_FieldEnums.hxx> | ||
| 11 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateRoofVegetation(RoofVegetation& modelObject) { | |
| 21 | ✗ | IdfObject idfObject(openstudio::IddObjectType::Material_RoofVegetation); | |
| 22 | |||
| 23 | ✗ | m_idfObjects.push_back(idfObject); | |
| 24 | |||
| 25 | ✗ | idfObject.setString(Material_RoofVegetationFields::Name, modelObject.name().get()); | |
| 26 | |||
| 27 | ✗ | OptionalDouble d = modelObject.getDouble(OS_Material_RoofVegetationFields::HeightofPlants, false); | |
| 28 | ✗ | if (d) { | |
| 29 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::HeightofPlants, *d); | |
| 30 | } | ||
| 31 | |||
| 32 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::LeafAreaIndex, false); | |
| 33 | ✗ | if (d) { | |
| 34 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::LeafAreaIndex, *d); | |
| 35 | } | ||
| 36 | |||
| 37 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::LeafReflectivity, false); | |
| 38 | ✗ | if (d) { | |
| 39 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::LeafReflectivity, *d); | |
| 40 | } | ||
| 41 | |||
| 42 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::LeafEmissivity, false); | |
| 43 | ✗ | if (d) { | |
| 44 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::LeafEmissivity, *d); | |
| 45 | } | ||
| 46 | |||
| 47 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::MinimumStomatalResistance, false); | |
| 48 | ✗ | if (d) { | |
| 49 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::MinimumStomatalResistance, *d); | |
| 50 | } | ||
| 51 | |||
| 52 | ✗ | OptionalString s = modelObject.getString(OS_Material_RoofVegetationFields::SoilLayerName, false, true); | |
| 53 | ✗ | if (s) { | |
| 54 | ✗ | idfObject.setString(Material_RoofVegetationFields::SoilLayerName, *s); | |
| 55 | } | ||
| 56 | |||
| 57 | ✗ | s = modelObject.getString(OS_Material_RoofVegetationFields::Roughness, false, true); | |
| 58 | ✗ | if (s) { | |
| 59 | ✗ | idfObject.setString(Material_RoofVegetationFields::Roughness, *s); | |
| 60 | } | ||
| 61 | |||
| 62 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::Thickness, false); | |
| 63 | ✗ | if (d) { | |
| 64 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::Thickness, *d); | |
| 65 | } | ||
| 66 | |||
| 67 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::ConductivityofDrySoil, false); | |
| 68 | ✗ | if (d) { | |
| 69 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::ConductivityofDrySoil, *d); | |
| 70 | } | ||
| 71 | |||
| 72 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::DensityofDrySoil, false); | |
| 73 | ✗ | if (d) { | |
| 74 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::DensityofDrySoil, *d); | |
| 75 | } | ||
| 76 | |||
| 77 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::SpecificHeatofDrySoil, false); | |
| 78 | ✗ | if (d) { | |
| 79 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::SpecificHeatofDrySoil, *d); | |
| 80 | } | ||
| 81 | |||
| 82 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::ThermalAbsorptance, false); | |
| 83 | ✗ | if (d) { | |
| 84 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::ThermalAbsorptance, *d); | |
| 85 | } | ||
| 86 | |||
| 87 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::SolarAbsorptance, false); | |
| 88 | ✗ | if (d) { | |
| 89 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::SolarAbsorptance, *d); | |
| 90 | } | ||
| 91 | |||
| 92 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::VisibleAbsorptance, false); | |
| 93 | ✗ | if (d) { | |
| 94 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::VisibleAbsorptance, *d); | |
| 95 | } | ||
| 96 | |||
| 97 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::SaturationVolumetricMoistureContentoftheSoilLayer, false); | |
| 98 | ✗ | if (d) { | |
| 99 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::SaturationVolumetricMoistureContentoftheSoilLayer, *d); | |
| 100 | } | ||
| 101 | |||
| 102 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::ResidualVolumetricMoistureContentoftheSoilLayer, false); | |
| 103 | ✗ | if (d) { | |
| 104 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::ResidualVolumetricMoistureContentoftheSoilLayer, *d); | |
| 105 | } | ||
| 106 | |||
| 107 | ✗ | d = modelObject.getDouble(OS_Material_RoofVegetationFields::InitialVolumetricMoistureContentoftheSoilLayer, false); | |
| 108 | ✗ | if (d) { | |
| 109 | ✗ | idfObject.setDouble(Material_RoofVegetationFields::InitialVolumetricMoistureContentoftheSoilLayer, *d); | |
| 110 | } | ||
| 111 | |||
| 112 | ✗ | s = modelObject.getString(OS_Material_RoofVegetationFields::MoistureDiffusionCalculationMethod, false, true); | |
| 113 | ✗ | if (s) { | |
| 114 | ✗ | idfObject.setString(Material_RoofVegetationFields::MoistureDiffusionCalculationMethod, *s); | |
| 115 | } | ||
| 116 | |||
| 117 | ✗ | return boost::optional<IdfObject>(idfObject); | |
| 118 | ✗ | } | |
| 119 | |||
| 120 | } // namespace energyplus | ||
| 121 | |||
| 122 | } // namespace openstudio | ||
| 123 |