src/energyplus/ForwardTranslator/ForwardTranslateCoilPerformanceDXCooling.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/CoilPerformanceDXCooling.hpp" | ||
| 8 | #include "../../model/CoilPerformanceDXCooling_Impl.hpp" | ||
| 9 | #include "../../model/Model.hpp" | ||
| 10 | #include "../../model/Curve.hpp" | ||
| 11 | #include "../../model/Curve_Impl.hpp" | ||
| 12 | #include "../../model/Node.hpp" | ||
| 13 | #include "../../model/Node_Impl.hpp" | ||
| 14 | #include "../../utilities/core/Assert.hpp" | ||
| 15 | #include <utilities/idd/CoilPerformance_DX_Cooling_FieldEnums.hxx> | ||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | |||
| 18 | using namespace openstudio::model; | ||
| 19 | using namespace std; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | 16 | boost::optional<IdfObject> ForwardTranslator::translateCoilPerformanceDXCooling(CoilPerformanceDXCooling& modelObject) { | |
| 26 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | IdfObject idfObject(IddObjectType::CoilPerformance_DX_Cooling); |
| 27 |
1/1✓ Branch 1 taken 16 times.
|
16 | m_idfObjects.push_back(idfObject); |
| 28 | |||
| 29 | // Name | ||
| 30 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
32 | if (auto s = modelObject.name()) { |
| 31 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setName(*s); |
| 32 | 16 | } | |
| 33 | |||
| 34 | // GrossRatedTotalCoolingCapacity | ||
| 35 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
16 | if (modelObject.isGrossRatedTotalCoolingCapacityAutosized()) { |
| 36 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(CoilPerformance_DX_CoolingFields::GrossRatedTotalCoolingCapacity, "Autosize"); |
| 37 | ✗ | } else if (auto value = modelObject.grossRatedTotalCoolingCapacity()) { | |
| 38 | ✗ | idfObject.setDouble(CoilPerformance_DX_CoolingFields::GrossRatedTotalCoolingCapacity, value.get()); | |
| 39 | } | ||
| 40 | |||
| 41 | // GrossRatedSensibleHeatRatio | ||
| 42 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
16 | if (modelObject.isGrossRatedSensibleHeatRatioAutosized()) { |
| 43 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(CoilPerformance_DX_CoolingFields::GrossRatedSensibleHeatRatio, "Autosize"); |
| 44 | ✗ | } else if (auto value = modelObject.grossRatedSensibleHeatRatio()) { | |
| 45 | ✗ | idfObject.setDouble(CoilPerformance_DX_CoolingFields::GrossRatedSensibleHeatRatio, value.get()); | |
| 46 | } | ||
| 47 | |||
| 48 | // GrossRatedCoolingCOP | ||
| 49 | { | ||
| 50 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.grossRatedCoolingCOP(); |
| 51 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::GrossRatedCoolingCOP, value); |
| 52 | } | ||
| 53 | |||
| 54 | // RatedAirFlowRate | ||
| 55 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
16 | if (modelObject.isRatedAirFlowRateAutosized()) { |
| 56 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(CoilPerformance_DX_CoolingFields::RatedAirFlowRate, "Autosize"); |
| 57 | ✗ | } else if (auto value = modelObject.ratedAirFlowRate()) { | |
| 58 | ✗ | idfObject.setDouble(CoilPerformance_DX_CoolingFields::RatedAirFlowRate, value.get()); | |
| 59 | } | ||
| 60 | |||
| 61 | // FractionofAirFlowBypassedAroundCoil | ||
| 62 | { | ||
| 63 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.fractionofAirFlowBypassedAroundCoil(); |
| 64 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::FractionofAirFlowBypassedAroundCoil, value); |
| 65 | } | ||
| 66 | |||
| 67 | // TotalCoolingCapacityFunctionofTemperatureCurveName | ||
| 68 | { | ||
| 69 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto curve = modelObject.totalCoolingCapacityFunctionofTemperatureCurve(); |
| 70 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
32 | if (auto idf = translateAndMapModelObject(curve)) { |
| 71 |
4/4✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
✓ Branch 10 taken 16 times.
|
16 | idfObject.setString(CoilPerformance_DX_CoolingFields::TotalCoolingCapacityFunctionofTemperatureCurveName, idf->name().get()); |
| 72 | 16 | } | |
| 73 | 16 | } | |
| 74 | |||
| 75 | // TotalCoolingCapacityFunctionofFlowFractionCurveName | ||
| 76 | { | ||
| 77 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto curve = modelObject.totalCoolingCapacityFunctionofFlowFractionCurve(); |
| 78 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
32 | if (auto idf = translateAndMapModelObject(curve)) { |
| 79 |
4/4✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
✓ Branch 10 taken 16 times.
|
16 | idfObject.setString(CoilPerformance_DX_CoolingFields::TotalCoolingCapacityFunctionofFlowFractionCurveName, idf->name().get()); |
| 80 | 16 | } | |
| 81 | 16 | } | |
| 82 | |||
| 83 | // EnergyInputRatioFunctionofTemperatureCurve | ||
| 84 | { | ||
| 85 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto curve = modelObject.energyInputRatioFunctionofTemperatureCurve(); |
| 86 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
32 | if (auto idf = translateAndMapModelObject(curve)) { |
| 87 |
4/4✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
✓ Branch 10 taken 16 times.
|
16 | idfObject.setString(CoilPerformance_DX_CoolingFields::EnergyInputRatioFunctionofTemperatureCurveName, idf->name().get()); |
| 88 | 16 | } | |
| 89 | 16 | } | |
| 90 | |||
| 91 | // EnergyInputRatioFunctionofFlowFractionCurve | ||
| 92 | { | ||
| 93 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto curve = modelObject.energyInputRatioFunctionofFlowFractionCurve(); |
| 94 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
32 | if (auto idf = translateAndMapModelObject(curve)) { |
| 95 |
4/4✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
✓ Branch 10 taken 16 times.
|
16 | idfObject.setString(CoilPerformance_DX_CoolingFields::EnergyInputRatioFunctionofFlowFractionCurveName, idf->name().get()); |
| 96 | 16 | } | |
| 97 | 16 | } | |
| 98 | |||
| 99 | // PartLoadFractionCorrelationCurveName | ||
| 100 | { | ||
| 101 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto curve = modelObject.partLoadFractionCorrelationCurve(); |
| 102 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
32 | if (auto idf = translateAndMapModelObject(curve)) { |
| 103 |
4/4✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
✓ Branch 10 taken 16 times.
|
16 | idfObject.setString(CoilPerformance_DX_CoolingFields::PartLoadFractionCorrelationCurveName, idf->name().get()); |
| 104 | 16 | } | |
| 105 | 16 | } | |
| 106 | |||
| 107 | // NominalTimeforCondensateRemovaltoBegin | ||
| 108 | { | ||
| 109 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.nominalTimeforCondensateRemovaltoBegin(); |
| 110 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::NominalTimeforCondensateRemovaltoBegin, value); |
| 111 | } | ||
| 112 | |||
| 113 | // RatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity | ||
| 114 | { | ||
| 115 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(); |
| 116 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::RatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity, value); |
| 117 | } | ||
| 118 | |||
| 119 | // MaximumCyclingRate | ||
| 120 | { | ||
| 121 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.maximumCyclingRate(); |
| 122 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::MaximumCyclingRate, value); |
| 123 | } | ||
| 124 | |||
| 125 | // LatentCapacityTimeConstant | ||
| 126 | { | ||
| 127 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.latentCapacityTimeConstant(); |
| 128 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::LatentCapacityTimeConstant, value); |
| 129 | } | ||
| 130 | |||
| 131 | // CondenserAirInletNode | ||
| 132 |
2/3✓ Branch 1 taken 16 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16 times.
|
32 | if (auto node = modelObject.condenserAirInletNode()) { |
| 133 | ✗ | idfObject.setString(CoilPerformance_DX_CoolingFields::CondenserAirInletNodeName, node->name().get()); | |
| 134 | 16 | } | |
| 135 | |||
| 136 | // CondenserType | ||
| 137 | { | ||
| 138 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.condenserType(); |
| 139 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setString(CoilPerformance_DX_CoolingFields::CondenserType, value); |
| 140 | 16 | } | |
| 141 | |||
| 142 | // EvaporativeCondenserEffectiveness | ||
| 143 | { | ||
| 144 |
1/1✓ Branch 1 taken 16 times.
|
16 | auto value = modelObject.evaporativeCondenserEffectiveness(); |
| 145 |
1/1✓ Branch 1 taken 16 times.
|
16 | idfObject.setDouble(CoilPerformance_DX_CoolingFields::EvaporativeCondenserEffectiveness, value); |
| 146 | } | ||
| 147 | |||
| 148 | // EvaporativeCondenserAirFlowRate | ||
| 149 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
16 | if (modelObject.isEvaporativeCondenserAirFlowRateAutosized()) { |
| 150 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(CoilPerformance_DX_CoolingFields::EvaporativeCondenserAirFlowRate, "Autosize"); |
| 151 | ✗ | } else if (auto value = modelObject.evaporativeCondenserAirFlowRate()) { | |
| 152 | ✗ | idfObject.setDouble(CoilPerformance_DX_CoolingFields::EvaporativeCondenserAirFlowRate, value.get()); | |
| 153 | } | ||
| 154 | |||
| 155 | // EvaporativeCondenserPumpRatedPowerConsumption | ||
| 156 |
2/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 16 times.
✗ Branch 4 not taken.
|
16 | if (modelObject.isEvaporativeCondenserPumpRatedPowerConsumptionAutosized()) { |
| 157 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(CoilPerformance_DX_CoolingFields::EvaporativeCondenserPumpRatedPowerConsumption, "Autosize"); |
| 158 | ✗ | } else if (auto value = modelObject.evaporativeCondenserPumpRatedPowerConsumption()) { | |
| 159 | ✗ | idfObject.setDouble(CoilPerformance_DX_CoolingFields::EvaporativeCondenserPumpRatedPowerConsumption, value.get()); | |
| 160 | } | ||
| 161 | |||
| 162 | // SensibleHeatRatioFunctionofTemperatureCurveName | ||
| 163 |
2/3✓ Branch 1 taken 16 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16 times.
|
32 | if (auto curve = modelObject.sensibleHeatRatioFunctionofTemperatureCurve()) { |
| 164 | ✗ | if (auto idf = translateAndMapModelObject(curve.get())) { | |
| 165 | ✗ | idfObject.setString(CoilPerformance_DX_CoolingFields::SensibleHeatRatioFunctionofTemperatureCurveName, idf->name().get()); | |
| 166 | ✗ | } | |
| 167 | 16 | } | |
| 168 | |||
| 169 | // SensibleHeatRatioFunctionofFlowFractionCurveName | ||
| 170 |
2/3✓ Branch 1 taken 16 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16 times.
|
32 | if (auto curve = modelObject.sensibleHeatRatioFunctionofFlowFractionCurve()) { |
| 171 | ✗ | if (auto idf = translateAndMapModelObject(curve.get())) { | |
| 172 | ✗ | idfObject.setString(CoilPerformance_DX_CoolingFields::SensibleHeatRatioFunctionofFlowFractionCurveName, idf->name().get()); | |
| 173 | ✗ | } | |
| 174 | 16 | } | |
| 175 | |||
| 176 |
1/1✓ Branch 1 taken 16 times.
|
32 | return idfObject; |
| 177 | 16 | } | |
| 178 | |||
| 179 | } // namespace energyplus | ||
| 180 | } // namespace openstudio | ||
| 181 |