src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationAirChiller.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/RefrigerationAirChiller.hpp" | ||
| 9 | #include "../../model/Schedule.hpp" | ||
| 10 | // #include <model/Curve.hpp> | ||
| 11 | // #include <model/Curve_Impl.hpp> | ||
| 12 | #include "../../model/Node.hpp" | ||
| 13 | #include "../../model/Node_Impl.hpp" | ||
| 14 | |||
| 15 | #include <utilities/idd/Refrigeration_AirChiller_FieldEnums.hxx> | ||
| 16 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 17 | #include <utilities/idd/IddEnums.hxx> | ||
| 18 | #include <utilities/idd/IddFactory.hxx> | ||
| 19 | |||
| 20 | using namespace openstudio::model; | ||
| 21 | |||
| 22 | namespace openstudio { | ||
| 23 | |||
| 24 | namespace energyplus { | ||
| 25 | |||
| 26 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateRefrigerationAirChiller(RefrigerationAirChiller& modelObject) { | |
| 27 | ✗ | OptionalModelObject temp; | |
| 28 | ✗ | OptionalString optS; | |
| 29 | ✗ | boost::optional<std::string> s; | |
| 30 | ✗ | boost::optional<double> d; | |
| 31 | |||
| 32 | // Name | ||
| 33 | ✗ | IdfObject object = createRegisterAndNameIdfObject(openstudio::IddObjectType::Refrigeration_AirChiller, modelObject); | |
| 34 | |||
| 35 | // AvailabilityScheduleName | ||
| 36 | ✗ | boost::optional<Schedule> availabilitySchedule = modelObject.availabilitySchedule(); | |
| 37 | |||
| 38 | ✗ | if (availabilitySchedule) { | |
| 39 | ✗ | boost::optional<IdfObject> _availabilitySchedule = translateAndMapModelObject(availabilitySchedule.get()); | |
| 40 | |||
| 41 | ✗ | if (_availabilitySchedule && _availabilitySchedule->name()) { | |
| 42 | ✗ | object.setString(Refrigeration_AirChillerFields::AvailabilityScheduleName, _availabilitySchedule->name().get()); | |
| 43 | } | ||
| 44 | ✗ | } | |
| 45 | |||
| 46 | //CapacityRatingType | ||
| 47 | ✗ | std::string capacityCorrectionCurveType; | |
| 48 | ✗ | s = modelObject.capacityRatingType(); | |
| 49 | ✗ | if (s) { | |
| 50 | ✗ | object.setString(Refrigeration_AirChillerFields::CapacityRatingType, s.get()); | |
| 51 | ✗ | if (istringEqual(s.get(), "UnitLoadFactorSensibleOnly")) { | |
| 52 | ✗ | capacityCorrectionCurveType = "LinearSHR60"; | |
| 53 | ✗ | } else if (s.get().find("European") != std::string::npos) { | |
| 54 | ✗ | capacityCorrectionCurveType = "European"; | |
| 55 | } else { | ||
| 56 | ✗ | capacityCorrectionCurveType = "LinearSHR60"; | |
| 57 | } | ||
| 58 | } | ||
| 59 | //RatedUnitLoadFactor | ||
| 60 | ✗ | d = modelObject.ratedUnitLoadFactor(); | |
| 61 | ✗ | if (d) { | |
| 62 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedUnitLoadFactor, d.get()); | |
| 63 | } | ||
| 64 | //RatedCapacity | ||
| 65 | ✗ | d = modelObject.ratedCapacity(); | |
| 66 | ✗ | if (d) { | |
| 67 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedCapacity, d.get()); | |
| 68 | } | ||
| 69 | //RatedRelativeHumidity | ||
| 70 | ✗ | d = modelObject.ratedRelativeHumidity(); | |
| 71 | ✗ | if (d) { | |
| 72 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedRelativeHumidity, d.get()); | |
| 73 | } | ||
| 74 | //RatedCoolingSourceTemperature | ||
| 75 | ✗ | d = modelObject.ratedCoolingSourceTemperature(); | |
| 76 | ✗ | if (d) { | |
| 77 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedCoolingSourceTemperature, d.get()); | |
| 78 | } | ||
| 79 | //RatedTemperatureDifferenceDT1 | ||
| 80 | ✗ | d = modelObject.ratedTemperatureDifferenceDT1(); | |
| 81 | ✗ | if (d) { | |
| 82 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedTemperatureDifferenceDT1, d.get()); | |
| 83 | } | ||
| 84 | //MaximumTemperatureDifferenceBetweenInletAirandEvaporatingTemperature | ||
| 85 | ✗ | d = modelObject.maximumTemperatureDifferenceBetweenInletAirandEvaporatingTemperature(); | |
| 86 | ✗ | if (d) { | |
| 87 | ✗ | object.setDouble(Refrigeration_AirChillerFields::MaximumTemperatureDifferenceBetweenInletAirandEvaporatingTemperature, d.get()); | |
| 88 | } | ||
| 89 | //CoilMaterialCorrectionFactor | ||
| 90 | ✗ | d = modelObject.coilMaterialCorrectionFactor(); | |
| 91 | ✗ | if (d) { | |
| 92 | ✗ | object.setDouble(Refrigeration_AirChillerFields::CoilMaterialCorrectionFactor, d.get()); | |
| 93 | } | ||
| 94 | //RefrigerantCorrectionFactor | ||
| 95 | ✗ | d = modelObject.refrigerantCorrectionFactor(); | |
| 96 | ✗ | if (d) { | |
| 97 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RefrigerantCorrectionFactor, d.get()); | |
| 98 | } | ||
| 99 | //CapacityCorrectionCurveType | ||
| 100 | // s = modelObject.capacityCorrectionCurveType(); | ||
| 101 | // if (s) { | ||
| 102 | // object.setString(Refrigeration_AirChillerFields::CapacityCorrectionCurveType,s.get()); | ||
| 103 | // } | ||
| 104 | ✗ | object.setString(Refrigeration_AirChillerFields::CapacityCorrectionCurveType, capacityCorrectionCurveType); | |
| 105 | //CapacityCorrectionCurveName | ||
| 106 | // boost::optional<Curve> capacityCorrectionCurve = modelObject.capacityCorrectionCurve(); | ||
| 107 | |||
| 108 | // if( capacityCorrectionCurve ) | ||
| 109 | // { | ||
| 110 | // boost::optional<IdfObject> _capacityCorrectionCurve = translateAndMapModelObject(capacityCorrectionCurve.get()); | ||
| 111 | |||
| 112 | // if( _capacityCorrectionCurve && _capacityCorrectionCurve->name() ) | ||
| 113 | // { | ||
| 114 | // object.setString(Refrigeration_AirChillerFields::CapacityCorrectionCurveName,_capacityCorrectionCurve->name().get()); | ||
| 115 | // } | ||
| 116 | // } | ||
| 117 | ✗ | object.setString(Refrigeration_AirChillerFields::CapacityCorrectionCurveName, ""); | |
| 118 | //SHR60CorrectionFactor | ||
| 119 | ✗ | d = modelObject.sHR60CorrectionFactor(); | |
| 120 | ✗ | if (d) { | |
| 121 | ✗ | object.setDouble(Refrigeration_AirChillerFields::SHR60CorrectionFactor, d.get()); | |
| 122 | } | ||
| 123 | //RatedTotalHeatingPower | ||
| 124 | ✗ | d = modelObject.ratedTotalHeatingPower(); | |
| 125 | ✗ | if (d) { | |
| 126 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedTotalHeatingPower, d.get()); | |
| 127 | } | ||
| 128 | //HeatingPowerScheduleName | ||
| 129 | ✗ | boost::optional<Schedule> heatingPowerSchedule = modelObject.heatingPowerSchedule(); | |
| 130 | |||
| 131 | ✗ | if (heatingPowerSchedule) { | |
| 132 | ✗ | boost::optional<IdfObject> _heatingPowerSchedule = translateAndMapModelObject(heatingPowerSchedule.get()); | |
| 133 | |||
| 134 | ✗ | if (_heatingPowerSchedule && _heatingPowerSchedule->name()) { | |
| 135 | ✗ | object.setString(Refrigeration_AirChillerFields::HeatingPowerScheduleName, _heatingPowerSchedule->name().get()); | |
| 136 | } | ||
| 137 | ✗ | } | |
| 138 | //FanSpeedControlType | ||
| 139 | ✗ | s = modelObject.fanSpeedControlType(); | |
| 140 | ✗ | if (s) { | |
| 141 | ✗ | object.setString(Refrigeration_AirChillerFields::FanSpeedControlType, s.get()); | |
| 142 | } | ||
| 143 | //RatedFanPower | ||
| 144 | ✗ | d = modelObject.ratedFanPower(); | |
| 145 | ✗ | if (d) { | |
| 146 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedFanPower, d.get()); | |
| 147 | } | ||
| 148 | //RatedAirFlow | ||
| 149 | ✗ | d = modelObject.ratedAirFlow(); | |
| 150 | ✗ | if (d) { | |
| 151 | ✗ | object.setDouble(Refrigeration_AirChillerFields::RatedAirFlow, d.get()); | |
| 152 | } | ||
| 153 | //MinimumFanAirFlowRatio | ||
| 154 | ✗ | d = modelObject.minimumFanAirFlowRatio(); | |
| 155 | ✗ | if (d) { | |
| 156 | ✗ | object.setDouble(Refrigeration_AirChillerFields::MinimumFanAirFlowRatio, d.get()); | |
| 157 | } | ||
| 158 | //DefrostType | ||
| 159 | ✗ | s = modelObject.defrostType(); | |
| 160 | ✗ | if (s) { | |
| 161 | ✗ | object.setString(Refrigeration_AirChillerFields::DefrostType, s.get()); | |
| 162 | } | ||
| 163 | //DefrostControlType | ||
| 164 | ✗ | s = modelObject.defrostControlType(); | |
| 165 | ✗ | if (s) { | |
| 166 | ✗ | object.setString(Refrigeration_AirChillerFields::DefrostControlType, s.get()); | |
| 167 | } | ||
| 168 | //DefrostScheduleName | ||
| 169 | ✗ | boost::optional<Schedule> defrostSchedule = modelObject.defrostSchedule(); | |
| 170 | |||
| 171 | ✗ | if (defrostSchedule) { | |
| 172 | ✗ | boost::optional<IdfObject> _defrostSchedule = translateAndMapModelObject(defrostSchedule.get()); | |
| 173 | |||
| 174 | ✗ | if (_defrostSchedule && _defrostSchedule->name()) { | |
| 175 | ✗ | object.setString(Refrigeration_AirChillerFields::DefrostScheduleName, _defrostSchedule->name().get()); | |
| 176 | } | ||
| 177 | ✗ | } | |
| 178 | //DefrostDripDownScheduleName | ||
| 179 | ✗ | boost::optional<Schedule> defrostDripDownSchedule = modelObject.defrostDripDownSchedule(); | |
| 180 | |||
| 181 | ✗ | if (defrostDripDownSchedule) { | |
| 182 | ✗ | boost::optional<IdfObject> _defrostDripDownSchedule = translateAndMapModelObject(defrostDripDownSchedule.get()); | |
| 183 | |||
| 184 | ✗ | if (_defrostDripDownSchedule && _defrostDripDownSchedule->name()) { | |
| 185 | ✗ | object.setString(Refrigeration_AirChillerFields::DefrostDripDownScheduleName, _defrostDripDownSchedule->name().get()); | |
| 186 | } | ||
| 187 | ✗ | } | |
| 188 | //DefrostPower | ||
| 189 | ✗ | d = modelObject.defrostPower(); | |
| 190 | ✗ | if (d) { | |
| 191 | ✗ | object.setDouble(Refrigeration_AirChillerFields::DefrostPower, d.get()); | |
| 192 | } | ||
| 193 | //TemperatureTerminationDefrostFractiontoIce | ||
| 194 | ✗ | d = modelObject.temperatureTerminationDefrostFractiontoIce(); | |
| 195 | ✗ | if (d) { | |
| 196 | ✗ | object.setDouble(Refrigeration_AirChillerFields::TemperatureTerminationDefrostFractiontoIce, d.get()); | |
| 197 | } | ||
| 198 | //VerticalLocation | ||
| 199 | ✗ | s = modelObject.verticalLocation(); | |
| 200 | ✗ | if (s) { | |
| 201 | ✗ | object.setString(Refrigeration_AirChillerFields::VerticalLocation, s.get()); | |
| 202 | } | ||
| 203 | //AverageRefrigerantChargeInventory | ||
| 204 | ✗ | d = modelObject.averageRefrigerantChargeInventory(); | |
| 205 | ✗ | if (d) { | |
| 206 | ✗ | object.setDouble(Refrigeration_AirChillerFields::AverageRefrigerantChargeInventory, d.get()); | |
| 207 | } | ||
| 208 | |||
| 209 | ✗ | return object; | |
| 210 | ✗ | } | |
| 211 | } // namespace energyplus | ||
| 212 | } // namespace openstudio | ||
| 213 |