src/energyplus/ForwardTranslator/ForwardTranslateHeatExchangerAirToAirSensibleAndLatent.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/HeatExchangerAirToAirSensibleAndLatent.hpp" | ||
| 9 | #include "../../model/HeatExchangerAirToAirSensibleAndLatent_Impl.hpp" | ||
| 10 | #include "../../model/Node.hpp" | ||
| 11 | #include "../../model/Node_Impl.hpp" | ||
| 12 | #include "../../model/Schedule.hpp" | ||
| 13 | #include "../../model/Curve.hpp" | ||
| 14 | #include "../../utilities/idf/Workspace.hpp" | ||
| 15 | #include "../../utilities/core/Logger.hpp" | ||
| 16 | #include <utilities/idd/HeatExchanger_AirToAir_SensibleAndLatent_FieldEnums.hxx> | ||
| 17 | #include <utilities/idd/IddEnums.hxx> | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | 10 | boost::optional<IdfObject> ForwardTranslator::translateHeatExchangerAirToAirSensibleAndLatent(HeatExchangerAirToAirSensibleAndLatent& modelObject) { | |
| 26 | 10 | OptionalString s; | |
| 27 | 10 | OptionalDouble d; | |
| 28 | 10 | OptionalModelObject temp; | |
| 29 | |||
| 30 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | IdfObject idfObject(IddObjectType::HeatExchanger_AirToAir_SensibleAndLatent); |
| 31 | |||
| 32 |
1/1✓ Branch 1 taken 10 times.
|
10 | m_idfObjects.push_back(idfObject); |
| 33 | |||
| 34 | // Name | ||
| 35 |
1/1✓ Branch 1 taken 10 times.
|
10 | s = modelObject.name(); |
| 36 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (s) { |
| 37 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setName(*s); |
| 38 | } | ||
| 39 | |||
| 40 | // AvailabilityScheduleName | ||
| 41 |
1/1✓ Branch 1 taken 10 times.
|
10 | Schedule sched = modelObject.availabilitySchedule(); |
| 42 |
1/1✓ Branch 1 taken 10 times.
|
10 | translateAndMapModelObject(sched); |
| 43 |
3/3✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
|
10 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::AvailabilityScheduleName, sched.name().get()); |
| 44 | |||
| 45 | // NominalSupplyAirFlowRate | ||
| 46 |
2/3✓ Branch 1 taken 10 times.
✓ Branch 3 taken 10 times.
✗ Branch 4 not taken.
|
10 | if (modelObject.isNominalSupplyAirFlowRateAutosized()) { |
| 47 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate, "Autosize"); |
| 48 | } else { | ||
| 49 | ✗ | d = modelObject.nominalSupplyAirFlowRate(); | |
| 50 | ✗ | if (d) { | |
| 51 | ✗ | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate, d.get()); | |
| 52 | } | ||
| 53 | } | ||
| 54 | |||
| 55 | // SensibleEffectivenessat100_HeatingAirFlow | ||
| 56 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | d = modelObject.sensibleEffectivenessat100HeatingAirFlow(); |
| 57 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (d) { |
| 58 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_HeatingAirFlow, d.get()); |
| 59 | } | ||
| 60 | |||
| 61 | // LatentEffectivenessat100_HeatingAirFlow | ||
| 62 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | d = modelObject.latentEffectivenessat100HeatingAirFlow(); |
| 63 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (d) { |
| 64 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_HeatingAirFlow, d.get()); |
| 65 | } | ||
| 66 | |||
| 67 | // SensibleEffectivenessat100_CoolingAirFlow | ||
| 68 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | d = modelObject.sensibleEffectivenessat100CoolingAirFlow(); |
| 69 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (d) { |
| 70 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_CoolingAirFlow, d.get()); |
| 71 | } | ||
| 72 | |||
| 73 | // LatentEffectivenessat100_CoolingAirFlow | ||
| 74 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | d = modelObject.latentEffectivenessat100CoolingAirFlow(); |
| 75 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (d) { |
| 76 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_CoolingAirFlow, d.get()); |
| 77 | } | ||
| 78 | |||
| 79 | // SupplyAirInletNodeName | ||
| 80 |
1/1✓ Branch 1 taken 10 times.
|
10 | temp = modelObject.primaryAirInletModelObject(); |
| 81 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
|
10 | if (temp) { |
| 82 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | s = temp->name(); |
| 83 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (s) { |
| 84 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirInletNodeName, *s); |
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | // SupplyAirOutletNodeName | ||
| 89 |
1/1✓ Branch 1 taken 10 times.
|
10 | temp = modelObject.primaryAirOutletModelObject(); |
| 90 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
|
10 | if (temp) { |
| 91 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | s = temp->name(); |
| 92 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (s) { |
| 93 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirOutletNodeName, *s); |
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | // ExhaustAirInletNodeName | ||
| 98 |
1/1✓ Branch 1 taken 10 times.
|
10 | temp = modelObject.secondaryAirInletModelObject(); |
| 99 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
|
10 | if (temp) { |
| 100 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | s = temp->name(); |
| 101 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (s) { |
| 102 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::ExhaustAirInletNodeName, *s); |
| 103 | } | ||
| 104 | } | ||
| 105 | |||
| 106 | // ExhaustAirOutletNodeName | ||
| 107 |
1/1✓ Branch 1 taken 10 times.
|
10 | temp = modelObject.secondaryAirOutletModelObject(); |
| 108 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
|
10 | if (temp) { |
| 109 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | s = temp->name(); |
| 110 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (s) { |
| 111 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::ExhaustAirOutletNodeName, *s); |
| 112 | } | ||
| 113 | } | ||
| 114 | |||
| 115 | // NominalElectricPower | ||
| 116 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | d = modelObject.nominalElectricPower(); |
| 117 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (d) { |
| 118 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::NominalElectricPower, *d); |
| 119 | } | ||
| 120 | |||
| 121 | // SupplyAirOutletTemperatureControl | ||
| 122 |
3/3✓ Branch 1 taken 10 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 8 times.
|
10 | if (modelObject.supplyAirOutletTemperatureControl()) { |
| 123 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirOutletTemperatureControl, "Yes"); |
| 124 | } else { | ||
| 125 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
16 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirOutletTemperatureControl, "No"); |
| 126 | } | ||
| 127 | |||
| 128 | // HeatExchangerType | ||
| 129 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | s = modelObject.heatExchangerType(); |
| 130 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (s) { |
| 131 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::HeatExchangerType, *s); |
| 132 | } | ||
| 133 | |||
| 134 | // FrostControlType | ||
| 135 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | s = modelObject.frostControlType(); |
| 136 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (s) { |
| 137 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::FrostControlType, *s); |
| 138 | } | ||
| 139 | |||
| 140 | // ThresholdTemperature | ||
| 141 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | d = modelObject.thresholdTemperature(); |
| 142 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | if (d) { |
| 143 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::ThresholdTemperature, *d); |
| 144 | } | ||
| 145 | |||
| 146 | // InitialDefrostTimeFraction | ||
| 147 |
1/1✓ Branch 1 taken 10 times.
|
10 | d = modelObject.initialDefrostTimeFraction(); |
| 148 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
|
10 | if (d) { |
| 149 | ✗ | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::InitialDefrostTimeFraction, *d); | |
| 150 | } | ||
| 151 | |||
| 152 | // RateofDefrostTimeFractionIncrease | ||
| 153 |
1/1✓ Branch 1 taken 10 times.
|
10 | d = modelObject.rateofDefrostTimeFractionIncrease(); |
| 154 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
|
10 | if (d) { |
| 155 | ✗ | idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::RateofDefrostTimeFractionIncrease, *d); | |
| 156 | } | ||
| 157 | |||
| 158 | // EconomizerLockout | ||
| 159 |
2/3✓ Branch 1 taken 10 times.
✓ Branch 3 taken 10 times.
✗ Branch 4 not taken.
|
10 | if (modelObject.economizerLockout()) { |
| 160 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::EconomizerLockout, "Yes"); |
| 161 | } else { | ||
| 162 | ✗ | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::EconomizerLockout, "No"); | |
| 163 | } | ||
| 164 | |||
| 165 | // SensibleEffectivenessofHeatingAirFlowCurveName | ||
| 166 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
20 | if (boost::optional<Curve> sensibleEffectivenessofHeatingAirFlowCurve_ = modelObject.sensibleEffectivenessofHeatingAirFlowCurve()) { |
| 167 | ✗ | if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(sensibleEffectivenessofHeatingAirFlowCurve_.get())) { | |
| 168 | ✗ | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofHeatingAirFlowCurveName, wo_->nameString()); | |
| 169 | ✗ | } | |
| 170 | 10 | } | |
| 171 | |||
| 172 | // LatentEffectivenessofHeatingAirFlowCurveName | ||
| 173 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
20 | if (boost::optional<Curve> latentEffectivenessofHeatingAirFlowCurve_ = modelObject.latentEffectivenessofHeatingAirFlowCurve()) { |
| 174 | ✗ | if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(latentEffectivenessofHeatingAirFlowCurve_.get())) { | |
| 175 | ✗ | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofHeatingAirFlowCurveName, wo_->nameString()); | |
| 176 | ✗ | } | |
| 177 | 10 | } | |
| 178 | |||
| 179 | // SensibleEffectivenessofCoolingAirFlowCurveName | ||
| 180 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
20 | if (boost::optional<Curve> sensibleEffectivenessofCoolingAirFlowCurve_ = modelObject.sensibleEffectivenessofCoolingAirFlowCurve()) { |
| 181 | ✗ | if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(sensibleEffectivenessofCoolingAirFlowCurve_.get())) { | |
| 182 | ✗ | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofCoolingAirFlowCurveName, wo_->nameString()); | |
| 183 | ✗ | } | |
| 184 | 10 | } | |
| 185 | |||
| 186 | // LatentEffectivenessofCoolingAirFlowCurveName | ||
| 187 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
20 | if (boost::optional<Curve> latentEffectivenessofCoolingAirFlowCurve_ = modelObject.latentEffectivenessofCoolingAirFlowCurve()) { |
| 188 | ✗ | if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(latentEffectivenessofCoolingAirFlowCurve_.get())) { | |
| 189 | ✗ | idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofCoolingAirFlowCurveName, wo_->nameString()); | |
| 190 | ✗ | } | |
| 191 | 10 | } | |
| 192 | |||
| 193 |
1/1✓ Branch 1 taken 10 times.
|
20 | return idfObject; |
| 194 | 10 | } | |
| 195 | |||
| 196 | } // namespace energyplus | ||
| 197 | |||
| 198 | } // namespace openstudio | ||
| 199 |