src/energyplus/ForwardTranslator/ForwardTranslateChillerHeaterPerformanceElectricEIR.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/Schedule.hpp" | ||
| 9 | #include "../../model/Schedule_Impl.hpp" | ||
| 10 | #include "../../model/Node.hpp" | ||
| 11 | #include "../../model/Node_Impl.hpp" | ||
| 12 | #include "../../model/ChillerHeaterPerformanceElectricEIR.hpp" | ||
| 13 | #include "../../model/ChillerHeaterPerformanceElectricEIR_Impl.hpp" | ||
| 14 | #include "../../model/Curve.hpp" | ||
| 15 | #include "../../utilities/core/Logger.hpp" | ||
| 16 | #include "../../utilities/core/Assert.hpp" | ||
| 17 | #include <utilities/idd/ChillerHeaterPerformance_Electric_EIR_FieldEnums.hxx> | ||
| 18 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 19 | #include <utilities/idd/IddEnums.hxx> | ||
| 20 | #include <utilities/idd/IddFactory.hxx> | ||
| 21 | |||
| 22 | using namespace openstudio::model; | ||
| 23 | |||
| 24 | using namespace std; | ||
| 25 | |||
| 26 | namespace openstudio { | ||
| 27 | |||
| 28 | namespace energyplus { | ||
| 29 | |||
| 30 | 3 | boost::optional<IdfObject> ForwardTranslator::translateChillerHeaterPerformanceElectricEIR(ChillerHeaterPerformanceElectricEIR& modelObject) { | |
| 31 | 3 | OptionalString s; | |
| 32 | 3 | OptionalDouble value; | |
| 33 | 3 | OptionalModelObject temp; | |
| 34 | |||
| 35 | // Name | ||
| 36 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ChillerHeaterPerformance_Electric_EIR, modelObject); |
| 37 | |||
| 38 | // ReferenceCoolingModeEvaporatorCapacity | ||
| 39 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (modelObject.isReferenceCoolingModeEvaporatorCapacityAutosized()) { |
| 40 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::ReferenceCoolingModeEvaporatorCapacity, "Autosize"); |
| 41 | ✗ | } else if ((value = modelObject.referenceCoolingModeEvaporatorCapacity())) { | |
| 42 | ✗ | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceCoolingModeEvaporatorCapacity, value.get()); | |
| 43 | } | ||
| 44 | |||
| 45 | // ReferenceCoolingModeCOP | ||
| 46 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceCoolingModeCOP())) { |
| 47 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceCoolingModeCOP, value.get()); |
| 48 | } | ||
| 49 | |||
| 50 | // ReferenceCoolingModeLeavingChilledWaterTemperature | ||
| 51 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceCoolingModeLeavingChilledWaterTemperature())) { |
| 52 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceCoolingModeLeavingChilledWaterTemperature, value.get()); |
| 53 | } | ||
| 54 | |||
| 55 | // ReferenceCoolingModeEnteringCondenserFluidTemperature | ||
| 56 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceCoolingModeEnteringCondenserFluidTemperature())) { |
| 57 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceCoolingModeEnteringCondenserFluidTemperature, value.get()); |
| 58 | } | ||
| 59 | |||
| 60 | // ReferenceCoolingModeLeavingCondenserWaterTemperature | ||
| 61 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceCoolingModeLeavingCondenserWaterTemperature())) { |
| 62 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceCoolingModeLeavingCondenserWaterTemperature, value.get()); |
| 63 | } | ||
| 64 | |||
| 65 | // ReferenceHeatingModeCoolingCapacityRatio | ||
| 66 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceHeatingModeCoolingCapacityRatio())) { |
| 67 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceHeatingModeCoolingCapacityRatio, value.get()); |
| 68 | } | ||
| 69 | |||
| 70 | // ReferenceHeatingModeCoolingPowerInputRatio | ||
| 71 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceHeatingModeCoolingPowerInputRatio())) { |
| 72 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceHeatingModeCoolingPowerInputRatio, value.get()); |
| 73 | } | ||
| 74 | |||
| 75 | // ReferenceHeatingModeLeavingChilledWaterTemperature | ||
| 76 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceHeatingModeLeavingChilledWaterTemperature())) { |
| 77 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceHeatingModeLeavingChilledWaterTemperature, value.get()); |
| 78 | } | ||
| 79 | |||
| 80 | // ReferenceHeatingModeLeavingCondenserWaterTemperature | ||
| 81 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceHeatingModeLeavingCondenserWaterTemperature())) { |
| 82 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceHeatingModeLeavingCondenserWaterTemperature, value.get()); |
| 83 | } | ||
| 84 | |||
| 85 | // ReferenceHeatingModeEnteringCondenserFluidTemperature | ||
| 86 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.referenceHeatingModeEnteringCondenserFluidTemperature())) { |
| 87 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::ReferenceHeatingModeEnteringCondenserFluidTemperature, value.get()); |
| 88 | } | ||
| 89 | |||
| 90 | // HeatingModeEnteringChilledWaterTemperatureLowLimit | ||
| 91 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.heatingModeEnteringChilledWaterTemperatureLowLimit())) { |
| 92 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::HeatingModeEnteringChilledWaterTemperatureLowLimit, value.get()); |
| 93 | } | ||
| 94 | |||
| 95 | // ChilledWaterFlowModeType | ||
| 96 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
|
6 | if ((s = modelObject.chilledWaterFlowModeType())) { |
| 97 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::ChilledWaterFlowModeType, s.get()); |
| 98 | } | ||
| 99 | |||
| 100 | // DesignChilledWaterFlowRate | ||
| 101 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (modelObject.isDesignChilledWaterFlowRateAutosized()) { |
| 102 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::DesignChilledWaterFlowRate, "Autosize"); |
| 103 | ✗ | } else if ((value = modelObject.designChilledWaterFlowRate())) { | |
| 104 | ✗ | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::DesignChilledWaterFlowRate, value.get()); | |
| 105 | } | ||
| 106 | |||
| 107 | // DesignCondenserWaterFlowRate | ||
| 108 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (modelObject.isDesignCondenserWaterFlowRateAutosized()) { |
| 109 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::DesignCondenserWaterFlowRate, "Autosize"); |
| 110 | ✗ | } else if ((value = modelObject.designCondenserWaterFlowRate())) { | |
| 111 | ✗ | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::DesignCondenserWaterFlowRate, value.get()); | |
| 112 | } | ||
| 113 | |||
| 114 | // DesignHotWaterFlowRate | ||
| 115 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.designHotWaterFlowRate())) { |
| 116 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::DesignHotWaterFlowRate, value.get()); |
| 117 | } | ||
| 118 | |||
| 119 | // CompressorMotorEfficiency | ||
| 120 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.compressorMotorEfficiency())) { |
| 121 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::CompressorMotorEfficiency, value.get()); |
| 122 | } | ||
| 123 | |||
| 124 | // CoolingModeTemperatureCurveCondenserWaterIndependentVariable | ||
| 125 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
|
6 | if ((s = modelObject.coolingModeTemperatureCurveCondenserWaterIndependentVariable())) { |
| 126 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::CoolingModeTemperatureCurveCondenserWaterIndependentVariable, s.get()); |
| 127 | } | ||
| 128 | |||
| 129 | // CoolingModeCoolingCapacityFunctionofTemperatureCurveName | ||
| 130 | { | ||
| 131 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto curve = modelObject.coolingModeCoolingCapacityFunctionOfTemperatureCurve(); |
| 132 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto _curve = translateAndMapModelObject(curve)) { |
| 133 | 3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::CoolingModeCoolingCapacityFunctionofTemperatureCurveName, | |
| 134 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | _curve->name().get()); |
| 135 | 3 | } | |
| 136 | 3 | } | |
| 137 | |||
| 138 | // CoolingModeElectricInputtoCoolingOutputRatioFunctionofTemperatureCurveName | ||
| 139 | { | ||
| 140 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto curve = modelObject.coolingModeElectricInputToCoolingOutputRatioFunctionOfTemperatureCurve(); |
| 141 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto _curve = translateAndMapModelObject(curve)) { |
| 142 | 3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::CoolingModeElectricInputtoCoolingOutputRatioFunctionofTemperatureCurveName, | |
| 143 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | _curve->name().get()); |
| 144 | 3 | } | |
| 145 | 3 | } | |
| 146 | |||
| 147 | // CoolingModeElectricInputtoCoolingOutputRatioFunctionofPartLoadRatioCurveName | ||
| 148 | { | ||
| 149 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto curve = modelObject.coolingModeElectricInputToCoolingOutputRatioFunctionOfPartLoadRatioCurve(); |
| 150 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto _curve = translateAndMapModelObject(curve)) { |
| 151 | 3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::CoolingModeElectricInputtoCoolingOutputRatioFunctionofPartLoadRatioCurveName, | |
| 152 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | _curve->name().get()); |
| 153 | 3 | } | |
| 154 | 3 | } | |
| 155 | |||
| 156 | // CoolingModeCoolingCapacityOptimumPartLoadRatio | ||
| 157 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.coolingModeCoolingCapacityOptimumPartLoadRatio())) { |
| 158 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::CoolingModeCoolingCapacityOptimumPartLoadRatio, value.get()); |
| 159 | } | ||
| 160 | |||
| 161 | // HeatingModeTemperatureCurveCondenserWaterIndependentVariable | ||
| 162 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
|
6 | if ((s = modelObject.heatingModeTemperatureCurveCondenserWaterIndependentVariable())) { |
| 163 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::HeatingModeTemperatureCurveCondenserWaterIndependentVariable, s.get()); |
| 164 | } | ||
| 165 | |||
| 166 | // HeatingModeCoolingCapacityFunctionofTemperatureCurveName | ||
| 167 | { | ||
| 168 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto curve = modelObject.heatingModeCoolingCapacityFunctionOfTemperatureCurve(); |
| 169 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto _curve = translateAndMapModelObject(curve)) { |
| 170 | 3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::HeatingModeCoolingCapacityFunctionofTemperatureCurveName, | |
| 171 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | _curve->name().get()); |
| 172 | 3 | } | |
| 173 | 3 | } | |
| 174 | |||
| 175 | // HeatingModeElectricInputtoCoolingOutputRatioFunctionofTemperatureCurveName | ||
| 176 | { | ||
| 177 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto curve = modelObject.heatingModeElectricInputToCoolingOutputRatioFunctionOfTemperatureCurve(); |
| 178 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto _curve = translateAndMapModelObject(curve)) { |
| 179 | 3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::HeatingModeElectricInputtoCoolingOutputRatioFunctionofTemperatureCurveName, | |
| 180 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | _curve->name().get()); |
| 181 | 3 | } | |
| 182 | 3 | } | |
| 183 | |||
| 184 | // HeatingModeElectricInputtoCoolingOutputRatioFunctionofPartLoadRatioCurveName | ||
| 185 | { | ||
| 186 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto curve = modelObject.heatingModeElectricInputToCoolingOutputRatioFunctionOfPartLoadRatioCurve(); |
| 187 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto _curve = translateAndMapModelObject(curve)) { |
| 188 | 3 | idfObject.setString(ChillerHeaterPerformance_Electric_EIRFields::HeatingModeElectricInputtoCoolingOutputRatioFunctionofPartLoadRatioCurveName, | |
| 189 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | _curve->name().get()); |
| 190 | 3 | } | |
| 191 | 3 | } | |
| 192 | |||
| 193 | // HeatingModeCoolingCapacityOptimumPartLoadRatio | ||
| 194 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.heatingModeCoolingCapacityOptimumPartLoadRatio())) { |
| 195 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::HeatingModeCoolingCapacityOptimumPartLoadRatio, value.get()); |
| 196 | } | ||
| 197 | |||
| 198 | // SizingFactor | ||
| 199 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if ((value = modelObject.sizingFactor())) { |
| 200 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setDouble(ChillerHeaterPerformance_Electric_EIRFields::SizingFactor, value.get()); |
| 201 | } | ||
| 202 | |||
| 203 |
1/1✓ Branch 1 taken 3 times.
|
6 | return idfObject; |
| 204 | 3 | } | |
| 205 | |||
| 206 | } // namespace energyplus | ||
| 207 | |||
| 208 | } // namespace openstudio | ||
| 209 |