src/energyplus/ForwardTranslator/ForwardTranslateGeneratorFuelCellStackCooler.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 | |||
| 8 | #include "../../model/Model.hpp" | ||
| 9 | #include "../../model/GeneratorFuelCellStackCooler.hpp" | ||
| 10 | #include "../../model/GeneratorFuelCellStackCooler_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../model/Connection.hpp" | ||
| 13 | #include "../../model/Connection_Impl.hpp" | ||
| 14 | #include "../../model/Node.hpp" | ||
| 15 | #include "../../model/Node_Impl.hpp" | ||
| 16 | |||
| 17 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 18 | |||
| 19 | #include <utilities/idd/Generator_FuelCell_StackCooler_FieldEnums.hxx> | ||
| 20 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 21 | #include <utilities/idd/IddEnums.hxx> | ||
| 22 | #include <utilities/idd/IddFactory.hxx> | ||
| 23 | |||
| 24 | using namespace openstudio::model; | ||
| 25 | |||
| 26 | using namespace std; | ||
| 27 | |||
| 28 | namespace openstudio { | ||
| 29 | |||
| 30 | namespace energyplus { | ||
| 31 | |||
| 32 | 1 | boost::optional<IdfObject> ForwardTranslator::translateGeneratorFuelCellStackCooler(GeneratorFuelCellStackCooler& modelObject) { | |
| 33 | 1 | boost::optional<std::string> s; | |
| 34 | 1 | boost::optional<double> d; | |
| 35 | 1 | boost::optional<Connection> connection; | |
| 36 | |||
| 37 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject pcm = createAndRegisterIdfObject(openstudio::IddObjectType::Generator_FuelCell_StackCooler, modelObject); |
| 38 | //Name | ||
| 39 |
1/1✓ Branch 1 taken 1 time.
|
1 | s = modelObject.name(); |
| 40 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (s) { |
| 41 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setName(*s); |
| 42 | } | ||
| 43 | |||
| 44 | // HeatRecoveryWaterInletNodeName | ||
| 45 | |||
| 46 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<ModelObject> mo = modelObject.inletModelObject()) { |
| 47 | ✗ | if (boost::optional<Node> node = mo->optionalCast<Node>()) { | |
| 48 | ✗ | pcm.setString(Generator_FuelCell_StackCoolerFields::HeatRecoveryWaterInletNodeName, node->name().get()); | |
| 49 | ✗ | } | |
| 50 | 1 | } | |
| 51 | |||
| 52 | // HeatRecoveryWaterOutletNodeName | ||
| 53 | |||
| 54 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<ModelObject> mo = modelObject.outletModelObject()) { |
| 55 | ✗ | if (boost::optional<Node> node = mo->optionalCast<Node>()) { | |
| 56 | ✗ | pcm.setString(Generator_FuelCell_StackCoolerFields::HeatRecoveryWaterOutletNodeName, node->name().get()); | |
| 57 | ✗ | } | |
| 58 | 1 | } | |
| 59 | /* | ||
| 60 | //HeatRecoveryWaterInletNodeName | ||
| 61 | connection = modelObject.heatRecoveryWaterInletNode(); | ||
| 62 | if (connection) { | ||
| 63 | pcm.setString(Generator_FuelCell_StackCoolerFields::HeatRecoveryWaterInletNodeName, connection.get().nameString()); | ||
| 64 | } | ||
| 65 | |||
| 66 | //HeatRecoveryWaterOutletNodeName | ||
| 67 | connection = modelObject.heatRecoveryWaterOutletNode(); | ||
| 68 | if (connection) { | ||
| 69 | pcm.setString(Generator_FuelCell_StackCoolerFields::HeatRecoveryWaterOutletNodeName, connection.get().nameString()); | ||
| 70 | } | ||
| 71 | */ | ||
| 72 | //NominalStackTemperature | ||
| 73 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.nominalStackTemperature(); |
| 74 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 75 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::NominalStackTemperature, d.get()); |
| 76 | } | ||
| 77 | |||
| 78 | //ActualStackTemperature | ||
| 79 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.actualStackTemperature(); |
| 80 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 81 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::ActualStackTemperature, d.get()); |
| 82 | } | ||
| 83 | |||
| 84 | //Coefficientr0 | ||
| 85 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.coefficientr0(); |
| 86 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 87 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::Coefficientr0, d.get()); |
| 88 | } | ||
| 89 | |||
| 90 | //Coefficientr1 | ||
| 91 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.coefficientr1(); |
| 92 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 93 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::Coefficientr1, d.get()); |
| 94 | } | ||
| 95 | |||
| 96 | //Coefficientr2 | ||
| 97 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.coefficientr2(); |
| 98 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 99 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::Coefficientr2, d.get()); |
| 100 | } | ||
| 101 | |||
| 102 | //Coefficientr3 | ||
| 103 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.coefficientr3(); |
| 104 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 105 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::Coefficientr3, d.get()); |
| 106 | } | ||
| 107 | |||
| 108 | //StackCoolantFlowRate | ||
| 109 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCoolantFlowRate(); |
| 110 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 111 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCoolantFlowRate, d.get()); |
| 112 | } | ||
| 113 | |||
| 114 | //StackCoolerUFactorTimesAreaValue | ||
| 115 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCoolerUFactorTimesAreaValue(); |
| 116 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 117 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCoolerUFactorTimesAreaValue, d.get()); |
| 118 | } | ||
| 119 | |||
| 120 | //FscogenAdjustmentFactor | ||
| 121 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.fscogenAdjustmentFactor(); |
| 122 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 123 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::FscogenAdjustmentFactor, d.get()); |
| 124 | } | ||
| 125 | |||
| 126 | //StackCogenerationExchangerArea | ||
| 127 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCogenerationExchangerArea(); |
| 128 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 129 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCogenerationExchangerArea, d.get()); |
| 130 | } | ||
| 131 | |||
| 132 | //StackCogenerationExchangerNominalFlowRate | ||
| 133 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCogenerationExchangerNominalFlowRate(); |
| 134 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 135 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCogenerationExchangerNominalFlowRate, d.get()); |
| 136 | } | ||
| 137 | |||
| 138 | //StackCogenerationExchangerNominalHeatTransferCoefficient | ||
| 139 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCogenerationExchangerNominalHeatTransferCoefficient(); |
| 140 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 141 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCogenerationExchangerNominalHeatTransferCoefficient, d.get()); |
| 142 | } | ||
| 143 | |||
| 144 | //StackCogenerationExchangerNominalHeatTransferCoefficientExponent | ||
| 145 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCogenerationExchangerNominalHeatTransferCoefficientExponent(); |
| 146 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 147 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCogenerationExchangerNominalHeatTransferCoefficientExponent, d.get()); |
| 148 | } | ||
| 149 | |||
| 150 | //StackCoolerPumpPower | ||
| 151 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCoolerPumpPower(); |
| 152 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 153 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCoolerPumpPower, d.get()); |
| 154 | } | ||
| 155 | |||
| 156 | //StackCoolerPumpHeatLossFraction | ||
| 157 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackCoolerPumpHeatLossFraction(); |
| 158 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 159 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackCoolerPumpHeatLossFraction, d.get()); |
| 160 | } | ||
| 161 | |||
| 162 | //StackAirCoolerFanCoefficientf0 | ||
| 163 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackAirCoolerFanCoefficientf0(); |
| 164 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 165 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackAirCoolerFanCoefficientf0, d.get()); |
| 166 | } | ||
| 167 | |||
| 168 | //StackAirCoolerFanCoefficientf1 | ||
| 169 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackAirCoolerFanCoefficientf1(); |
| 170 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 171 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackAirCoolerFanCoefficientf1, d.get()); |
| 172 | } | ||
| 173 | |||
| 174 | //StackAirCoolerFanCoefficientf2 | ||
| 175 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | d = modelObject.stackAirCoolerFanCoefficientf2(); |
| 176 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 177 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | pcm.setDouble(Generator_FuelCell_StackCoolerFields::StackAirCoolerFanCoefficientf2, d.get()); |
| 178 | } | ||
| 179 | |||
| 180 |
1/1✓ Branch 1 taken 1 time.
|
2 | return pcm; |
| 181 | 1 | } | |
| 182 | |||
| 183 | } // namespace energyplus | ||
| 184 | |||
| 185 | } // namespace openstudio | ||
| 186 |