src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXCurveFitOperatingMode.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 | |||
| 9 | #include "../../model/CoilCoolingDXCurveFitOperatingMode.hpp" | ||
| 10 | |||
| 11 | #include "../../model/CoilCoolingDXCurveFitSpeed.hpp" | ||
| 12 | #include "../../model/CoilCoolingDXCurveFitSpeed_Impl.hpp" | ||
| 13 | |||
| 14 | #include <utilities/idd/Coil_Cooling_DX_CurveFit_OperatingMode_FieldEnums.hxx> | ||
| 15 | // #include "../../utilities/idd/IddEnums.hpp" | ||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | 16 | boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXCurveFitOperatingMode(model::CoilCoolingDXCurveFitOperatingMode& modelObject) { | |
| 26 | 16 | boost::optional<std::string> s; | |
| 27 | 16 | boost::optional<double> value; | |
| 28 | |||
| 29 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | IdfObject idfObject(openstudio::IddObjectType::Coil_Cooling_DX_CurveFit_OperatingMode); |
| 30 | |||
| 31 |
1/1✓ Branch 1 taken 16 times.
|
16 | m_idfObjects.push_back(idfObject); |
| 32 | |||
| 33 | // Name | ||
| 34 |
3/3✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
|
16 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::Name, modelObject.name().get()); |
| 35 | |||
| 36 | // RatedGrossTotalCoolingCapacity | ||
| 37 |
1/1✓ Branch 1 taken 16 times.
|
16 | value = modelObject.ratedGrossTotalCoolingCapacity(); |
| 38 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (value) { |
| 39 | ✗ | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatedGrossTotalCoolingCapacity, value.get()); | |
| 40 | } else { | ||
| 41 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatedGrossTotalCoolingCapacity, "Autosize"); |
| 42 | } | ||
| 43 | |||
| 44 | // RatedEvaporatorAirFlowRate | ||
| 45 |
1/1✓ Branch 1 taken 16 times.
|
16 | value = modelObject.ratedEvaporatorAirFlowRate(); |
| 46 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (value) { |
| 47 | ✗ | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatedEvaporatorAirFlowRate, value.get()); | |
| 48 | } else { | ||
| 49 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatedEvaporatorAirFlowRate, "Autosize"); |
| 50 | } | ||
| 51 | |||
| 52 | // RatedCondenserAirFlowRate: Unused if condenserType = "AirCooled" | ||
| 53 |
1/1✓ Branch 1 taken 16 times.
|
16 | value = modelObject.ratedCondenserAirFlowRate(); |
| 54 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (value) { |
| 55 | ✗ | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatedCondenserAirFlowRate, value.get()); | |
| 56 | } else { | ||
| 57 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatedCondenserAirFlowRate, "Autosize"); |
| 58 | } | ||
| 59 | |||
| 60 | // MaximumCyclingRate | ||
| 61 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::MaximumCyclingRate, modelObject.maximumCyclingRate()); |
| 62 | |||
| 63 | // RatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity | ||
| 64 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::RatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity, |
| 65 | modelObject.ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity()); | ||
| 66 | |||
| 67 | // LatentCapacityTimeConstant | ||
| 68 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::LatentCapacityTimeConstant, modelObject.latentCapacityTimeConstant()); |
| 69 | |||
| 70 | // NominalTimeforCondensateRemovaltoBegin | ||
| 71 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::NominalTimeforCondensateRemovaltoBegin, |
| 72 | modelObject.nominalTimeforCondensateRemovaltoBegin()); | ||
| 73 | |||
| 74 | // ApplyPartLoadFractiontoSpeedsGreaterthan1 | ||
| 75 |
2/3✓ Branch 1 taken 16 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16 times.
|
16 | if (modelObject.applyPartLoadFractiontoSpeedsGreaterthan1()) { |
| 76 | ✗ | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::ApplyPartLoadFractiontoSpeedsGreaterthan1, "Yes"); | |
| 77 | } else { | ||
| 78 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::ApplyPartLoadFractiontoSpeedsGreaterthan1, "No"); |
| 79 | } | ||
| 80 | |||
| 81 | // ApplyLatentDegradationtoSpeedsGreaterthan1 | ||
| 82 |
2/3✓ Branch 1 taken 16 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 16 times.
|
16 | if (modelObject.applyLatentDegradationtoSpeedsGreaterthan1()) { |
| 83 | ✗ | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::ApplyLatentDegradationtoSpeedsGreaterthan1, "Yes"); | |
| 84 | } else { | ||
| 85 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::ApplyLatentDegradationtoSpeedsGreaterthan1, "No"); |
| 86 | } | ||
| 87 | |||
| 88 | // CondenserType | ||
| 89 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::CondenserType, modelObject.condenserType()); |
| 90 | |||
| 91 | // NominalEvaporativeCondenserPumpPower | ||
| 92 |
1/1✓ Branch 1 taken 16 times.
|
16 | value = modelObject.nominalEvaporativeCondenserPumpPower(); |
| 93 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (value) { |
| 94 | ✗ | idfObject.setDouble(Coil_Cooling_DX_CurveFit_OperatingModeFields::NominalEvaporativeCondenserPumpPower, value.get()); | |
| 95 | } else { | ||
| 96 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | idfObject.setString(Coil_Cooling_DX_CurveFit_OperatingModeFields::NominalEvaporativeCondenserPumpPower, "Autosize"); |
| 97 | } | ||
| 98 | |||
| 99 | // NominalSpeedNumber | ||
| 100 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | idfObject.setInt(Coil_Cooling_DX_CurveFit_OperatingModeFields::NominalSpeedNumber, modelObject.nominalSpeedNumber()); |
| 101 | |||
| 102 | // SpeedxName | ||
| 103 |
3/3✓ Branch 1 taken 16 times.
✓ Branch 8 taken 11 times.
✓ Branch 9 taken 16 times.
|
27 | for (auto& speed : modelObject.speeds()) { |
| 104 |
2/3✓ Branch 1 taken 11 times.
✓ Branch 3 taken 11 times.
✗ Branch 4 not taken.
|
22 | if (auto _s = translateAndMapModelObject(speed)) { |
| 105 |
1/1✓ Branch 1 taken 11 times.
|
11 | auto eg = idfObject.pushExtensibleGroup(); |
| 106 |
3/3✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 7 taken 11 times.
|
11 | eg.setString(Coil_Cooling_DX_CurveFit_OperatingModeExtensibleFields::SpeedName, _s->nameString()); |
| 107 | 11 | } else { | |
| 108 | ✗ | LOG(Warn, modelObject.briefDescription() << " cannot translate speed " << _s->briefDescription()); | |
| 109 | 11 | } | |
| 110 | 16 | } | |
| 111 | |||
| 112 |
1/1✓ Branch 1 taken 16 times.
|
32 | return idfObject; |
| 113 | 16 | } // End of translate function | |
| 114 | |||
| 115 | } // end namespace energyplus | ||
| 116 | } // end namespace openstudio | ||
| 117 |