src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingGasMultiStage.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/CoilHeatingGasMultiStage.hpp" | ||
| 9 | #include "../../model/CoilHeatingGasMultiStage_Impl.hpp" | ||
| 10 | #include "../../model/CoilHeatingGasMultiStageStageData.hpp" | ||
| 11 | #include "../../model/CoilHeatingGasMultiStageStageData_Impl.hpp" | ||
| 12 | #include "../../model/Node.hpp" | ||
| 13 | #include "../../model/Node_Impl.hpp" | ||
| 14 | #include "../../model/Schedule.hpp" | ||
| 15 | #include "../../model/Schedule_Impl.hpp" | ||
| 16 | #include "../../model/Curve.hpp" | ||
| 17 | #include "../../model/Curve_Impl.hpp" | ||
| 18 | #include <utilities/idd/Coil_Heating_Gas_MultiStage_FieldEnums.hxx> | ||
| 19 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 20 | #include <utilities/idd/IddEnums.hxx> | ||
| 21 | #include <utilities/idd/IddFactory.hxx> | ||
| 22 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 23 | |||
| 24 | using namespace openstudio::model; | ||
| 25 | |||
| 26 | namespace openstudio { | ||
| 27 | |||
| 28 | namespace energyplus { | ||
| 29 | |||
| 30 | 4 | boost::optional<IdfObject> ForwardTranslator::translateCoilHeatingGasMultiStage(CoilHeatingGasMultiStage& modelObject) { | |
| 31 | 4 | boost::optional<std::string> s; | |
| 32 | 4 | boost::optional<double> value; | |
| 33 | |||
| 34 | // Name | ||
| 35 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Coil_Heating_Gas_MultiStage, modelObject); |
| 36 | |||
| 37 | // AvailabilityScheduleName | ||
| 38 | { | ||
| 39 |
1/1✓ Branch 1 taken 4 times.
|
4 | auto schedule = modelObject.availabilitySchedule(); |
| 40 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
|
8 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule)) { |
| 41 |
4/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
|
4 | idfObject.setString(Coil_Heating_Gas_MultiStageFields::AvailabilityScheduleName, _schedule->name().get()); |
| 42 | 4 | } | |
| 43 | 4 | } | |
| 44 | |||
| 45 | // AirInletNodeName | ||
| 46 |
2/3✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
|
8 | if (auto node = modelObject.inletModelObject()) { |
| 47 | ✗ | idfObject.setString(Coil_Heating_Gas_MultiStageFields::AirInletNodeName, node->name().get()); | |
| 48 | 4 | } | |
| 49 | |||
| 50 | // AirOutletNodeName | ||
| 51 | // TemperatureSetpointNodeName | ||
| 52 |
2/3✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
|
8 | if (auto node = modelObject.outletModelObject()) { |
| 53 | ✗ | idfObject.setString(Coil_Heating_Gas_MultiStageFields::AirOutletNodeName, node->name().get()); | |
| 54 | ✗ | idfObject.setString(Coil_Heating_Gas_MultiStageFields::TemperatureSetpointNodeName, node->name().get()); | |
| 55 | 4 | } | |
| 56 | |||
| 57 | // PartLoadFractionCorrelationCurveName | ||
| 58 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
8 | if (auto curve = modelObject.partLoadFractionCorrelationCurve()) { |
| 59 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (auto _curve = translateAndMapModelObject(curve.get())) { |
| 60 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(Coil_Heating_Gas_MultiStageFields::PartLoadFractionCorrelationCurveName, _curve->name().get()); |
| 61 | 2 | } | |
| 62 | 4 | } | |
| 63 | |||
| 64 | // OffCycleParasiticGasLoad | ||
| 65 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
8 | if ((value = modelObject.offCycleParasiticGasLoad())) { |
| 66 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Coil_Heating_Gas_MultiStageFields::OffCycleParasiticGasLoad, value.get()); |
| 67 | } | ||
| 68 | |||
| 69 |
1/1✓ Branch 1 taken 4 times.
|
4 | const auto stages = modelObject.stages(); |
| 70 | |||
| 71 | // NumberofStages | ||
| 72 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 2 times.
|
4 | if (!stages.empty()) { |
| 73 |
1/1✓ Branch 2 taken 2 times.
|
2 | idfObject.setInt(Coil_Heating_Gas_MultiStageFields::NumberofStages, stages.size()); |
| 74 | } | ||
| 75 | |||
| 76 |
2/2✓ Branch 5 taken 2 times.
✓ Branch 6 taken 4 times.
|
6 | for (const auto& stage : stages) { |
| 77 |
1/1✓ Branch 1 taken 2 times.
|
2 | auto eg = idfObject.pushExtensibleGroup(); |
| 78 | |||
| 79 | // StageGasBurnerEfficiency | ||
| 80 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | eg.setDouble(Coil_Heating_Gas_MultiStageExtensibleFields::StageGasBurnerEfficiency, stage.gasBurnerEfficiency()); |
| 81 | |||
| 82 | // StageNominalCapacity | ||
| 83 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (stage.isNominalCapacityAutosized()) { |
| 84 | ✗ | eg.setString(Coil_Heating_Gas_MultiStageExtensibleFields::StageNominalCapacity, "AutoSize"); | |
| 85 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = stage.nominalCapacity())) { |
| 86 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | eg.setDouble(Coil_Heating_Gas_MultiStageExtensibleFields::StageNominalCapacity, value.get()); |
| 87 | } | ||
| 88 | |||
| 89 | // StageOnCycleParasiticElectricLoad | ||
| 90 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | eg.setDouble(Coil_Heating_Gas_MultiStageExtensibleFields::StageOnCycleParasiticElectricLoad, stage.onCycleParasiticElectricLoad()); |
| 91 | 2 | } | |
| 92 | |||
| 93 |
1/1✓ Branch 1 taken 4 times.
|
8 | return idfObject; |
| 94 | 4 | } | |
| 95 | |||
| 96 | } // namespace energyplus | ||
| 97 | |||
| 98 | } // namespace openstudio | ||
| 99 |