src/model/GeneratorFuelCell.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 "Model.hpp" | ||
| 7 | #include "Model_Impl.hpp" | ||
| 8 | |||
| 9 | #include "GeneratorFuelCell.hpp" | ||
| 10 | #include "GeneratorFuelCell_Impl.hpp" | ||
| 11 | #include "GeneratorFuelCellPowerModule.hpp" | ||
| 12 | #include "GeneratorFuelCellPowerModule_Impl.hpp" | ||
| 13 | #include "GeneratorFuelCellAirSupply.hpp" | ||
| 14 | #include "GeneratorFuelCellAirSupply_Impl.hpp" | ||
| 15 | #include "GeneratorFuelCellWaterSupply.hpp" | ||
| 16 | #include "GeneratorFuelCellWaterSupply_Impl.hpp" | ||
| 17 | #include "GeneratorFuelCellAuxiliaryHeater.hpp" | ||
| 18 | #include "GeneratorFuelCellAuxiliaryHeater_Impl.hpp" | ||
| 19 | #include "GeneratorFuelCellExhaustGasToWaterHeatExchanger.hpp" | ||
| 20 | #include "GeneratorFuelCellExhaustGasToWaterHeatExchanger_Impl.hpp" | ||
| 21 | #include "GeneratorFuelCellElectricalStorage.hpp" | ||
| 22 | #include "GeneratorFuelCellElectricalStorage_Impl.hpp" | ||
| 23 | #include "GeneratorFuelCellInverter.hpp" | ||
| 24 | #include "GeneratorFuelCellInverter_Impl.hpp" | ||
| 25 | #include "GeneratorFuelCellStackCooler.hpp" | ||
| 26 | #include "GeneratorFuelCellStackCooler_Impl.hpp" | ||
| 27 | #include "GeneratorFuelSupply.hpp" | ||
| 28 | #include "GeneratorFuelSupply_Impl.hpp" | ||
| 29 | #include "CurveQuadratic.hpp" | ||
| 30 | #include "CurveQuadratic_Impl.hpp" | ||
| 31 | #include "CurveCubic.hpp" | ||
| 32 | #include "CurveCubic_Impl.hpp" | ||
| 33 | |||
| 34 | #include "Schedule.hpp" | ||
| 35 | #include "Schedule_Impl.hpp" | ||
| 36 | |||
| 37 | #include <utilities/idd/IddEnums.hxx> | ||
| 38 | #include <utilities/idd/OS_Generator_FuelCell_FieldEnums.hxx> | ||
| 39 | |||
| 40 | #include "../utilities/core/Assert.hpp" | ||
| 41 | |||
| 42 | namespace openstudio { | ||
| 43 | namespace model { | ||
| 44 | |||
| 45 | namespace detail { | ||
| 46 | |||
| 47 | 7 | GeneratorFuelCell_Impl::GeneratorFuelCell_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 48 | 7 | : Generator_Impl(idfObject, model, keepHandle) { | |
| 49 |
4/6✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 7 times.
✗ Branch 13 not taken.
|
7 | OS_ASSERT(idfObject.iddObject().type() == GeneratorFuelCell::iddObjectType()); |
| 50 | 7 | } | |
| 51 | |||
| 52 | ✗ | GeneratorFuelCell_Impl::GeneratorFuelCell_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 53 | ✗ | : Generator_Impl(other, model, keepHandle) { | |
| 54 | ✗ | OS_ASSERT(other.iddObject().type() == GeneratorFuelCell::iddObjectType()); | |
| 55 | ✗ | } | |
| 56 | |||
| 57 | 6 | GeneratorFuelCell_Impl::GeneratorFuelCell_Impl(const GeneratorFuelCell_Impl& other, Model_Impl* model, bool keepHandle) | |
| 58 | 6 | : Generator_Impl(other, model, keepHandle) {} | |
| 59 | |||
| 60 | ✗ | const std::vector<std::string>& GeneratorFuelCell_Impl::outputVariableNames() const { | |
| 61 | static const std::vector<std::string> result{ | ||
| 62 | "Generator Produced AC Electricity Rate", "Generator Produced AC Electricity Energy", "Generator Produced Thermal Rate", | ||
| 63 | "Generator Produced Thermal Energy", "Generator Fuel HHV Basis Energy", "Generator Fuel HHV Basis Rate", "Generator Fuel LHV Basis Energy", | ||
| 64 | "Generator Fuel Consumption Rate LHV Basis", "FuelCell Heat Loss Rate to Zone", "FuelCell Heat Loss Energy to Zone", | ||
| 65 | "FuelCell Convection Heat Loss Rate to Zone", "FuelCell Radiation Heat Loss Rate to Zone", | ||
| 66 | |||
| 67 | // From FuelSupply object | ||
| 68 | "Generator Fuel Compressor Electricity Rate", "Generator Fuel Compressor Electricity Energy", "Generator Fuel Compressor Skin Heat Loss Rate" | ||
| 69 | |||
| 70 | ✗ | }; | |
| 71 | ✗ | return result; | |
| 72 | ✗ | } | |
| 73 | |||
| 74 | ✗ | IddObjectType GeneratorFuelCell_Impl::iddObjectType() const { | |
| 75 | ✗ | return GeneratorFuelCell::iddObjectType(); | |
| 76 | } | ||
| 77 | |||
| 78 | 3 | std::string GeneratorFuelCell_Impl::generatorObjectType() const { | |
| 79 | // translated to ElectricLoadCenter:Generators 'Generator Object Type' | ||
| 80 |
1/1✓ Branch 1 taken 3 times.
|
6 | return "Generator:FuelCell"; |
| 81 | } | ||
| 82 | |||
| 83 | // This will clone the GeneratorFuelCell as well as the Accessories if there are any | ||
| 84 | // and will return a reference to the GeneratorFuelCell | ||
| 85 | 1 | ModelObject GeneratorFuelCell_Impl::clone(Model model) const { | |
| 86 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | auto newFC = ModelObject_Impl::clone(model).cast<GeneratorFuelCell>(); |
| 87 | |||
| 88 | // If there's a GeneratorFuelCellPowerModule, clone it as well | ||
| 89 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellPowerModule> pm = powerModule()) { |
| 90 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 91 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | auto pmClone = pm->getImpl<detail::GeneratorFuelCellPowerModule_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellPowerModule>(); |
| 92 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setPowerModule(pmClone); |
| 93 | 2 | } | |
| 94 | |||
| 95 | // If there's a GeneratorFuelCellAirSupply, clone it as well | ||
| 96 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellAirSupply> as = airSupply()) { |
| 97 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 98 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | auto asClone = as->getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellAirSupply>(); |
| 99 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setAirSupply(asClone); |
| 100 | 2 | } | |
| 101 | // If there's a GeneratorFuelCellWaterSupply, clone it as well | ||
| 102 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellWaterSupply> ws = waterSupply()) { |
| 103 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 104 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | auto wsClone = ws->getImpl<detail::GeneratorFuelCellWaterSupply_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellWaterSupply>(); |
| 105 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setWaterSupply(wsClone); |
| 106 | 2 | } | |
| 107 | // If there's a GeneratorFuelCellAuxiliaryHeater, clone it as well | ||
| 108 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellAuxiliaryHeater> ht = auxiliaryHeater()) { |
| 109 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 110 | auto htClone = | ||
| 111 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | ht->getImpl<detail::GeneratorFuelCellAuxiliaryHeater_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellAuxiliaryHeater>(); |
| 112 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setAuxiliaryHeater(htClone); |
| 113 | 2 | } | |
| 114 | // If there's a GeneratorFuelCellExhaustGasToWaterHeatExchanger, clone it as well | ||
| 115 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellExhaustGasToWaterHeatExchanger> hx = heatExchanger()) { |
| 116 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 117 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto hxClone = hx->getImpl<detail::GeneratorFuelCellExhaustGasToWaterHeatExchanger_Impl>() |
| 118 |
2/2✓ Branch 2 taken 1 time.
✓ Branch 5 taken 1 time.
|
2 | ->ModelObject_Impl::clone(model) |
| 119 |
1/1✓ Branch 1 taken 1 time.
|
1 | .cast<GeneratorFuelCellExhaustGasToWaterHeatExchanger>(); |
| 120 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setHeatExchanger(hxClone); |
| 121 | 2 | } | |
| 122 | // If there's a GeneratorFuelCellElectricalStorage, clone it as well | ||
| 123 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellElectricalStorage> es = electricalStorage()) { |
| 124 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 125 | auto esClone = | ||
| 126 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | es->getImpl<detail::GeneratorFuelCellElectricalStorage_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellElectricalStorage>(); |
| 127 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setElectricalStorage(esClone); |
| 128 | 2 | } | |
| 129 | // If there's a GeneratorFuelCellInverter, clone it as well | ||
| 130 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelCellInverter> in = inverter()) { |
| 131 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 132 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | auto inClone = in->getImpl<detail::GeneratorFuelCellInverter_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellInverter>(); |
| 133 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setInverter(inClone); |
| 134 | 2 | } | |
| 135 | // If there's a GeneratorFuelCellStackCooler, clone it as well | ||
| 136 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<GeneratorFuelCellStackCooler> sc = stackCooler()) { |
| 137 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 138 | ✗ | auto scClone = sc->getImpl<detail::GeneratorFuelCellStackCooler_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelCellStackCooler>(); | |
| 139 | ✗ | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setStackCooler(scClone); | |
| 140 | 1 | } | |
| 141 | // If there's a GeneratorFuelSupply, clone it as well | ||
| 142 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<GeneratorFuelSupply> fs = fuelSupply()) { |
| 143 | // Call the BaseClass (ModelObject) clone method to avoid circular references | ||
| 144 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
|
1 | auto fsClone = fs->getImpl<detail::GeneratorFuelSupply_Impl>()->ModelObject_Impl::clone(model).cast<GeneratorFuelSupply>(); |
| 145 |
1/1✓ Branch 3 taken 1 time.
|
1 | newFC.getImpl<detail::GeneratorFuelCell_Impl>()->setFuelSupply(fsClone); |
| 146 | 2 | } | |
| 147 | |||
| 148 | 2 | return std::move(newFC); | |
| 149 | 1 | } | |
| 150 | |||
| 151 | // Return allowable child types | ||
| 152 | ✗ | std::vector<IddObjectType> GeneratorFuelCell_Impl::allowableChildTypes() const { | |
| 153 | ✗ | std::vector<IddObjectType> result; | |
| 154 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_PowerModule); | |
| 155 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_AirSupply); | |
| 156 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_WaterSupply); | |
| 157 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_AuxiliaryHeater); | |
| 158 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_ElectricalStorage); | |
| 159 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_Inverter); | |
| 160 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelCell_StackCooler); | |
| 161 | ✗ | result.push_back(IddObjectType::OS_Generator_FuelSupply); | |
| 162 | ✗ | result.push_back(IddObjectType::OS_Curve_Biquadratic); | |
| 163 | ✗ | result.push_back(IddObjectType::OS_Curve_Cubic); | |
| 164 | ✗ | result.push_back(IddObjectType::OS_Curve_Quadratic); | |
| 165 | ✗ | result.push_back(IddObjectType::OS_ThermalZone); | |
| 166 | ✗ | return result; | |
| 167 | ✗ | } | |
| 168 | |||
| 169 | // Returns the children objects if they exists | ||
| 170 | 5 | std::vector<ModelObject> GeneratorFuelCell_Impl::children() const { | |
| 171 | 5 | std::vector<ModelObject> result; | |
| 172 | 5 | boost::optional<CurveQuadratic> curveQ; | |
| 173 | 5 | boost::optional<CurveCubic> curveC; | |
| 174 | |||
| 175 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelCellPowerModule> pm = powerModule()) { |
| 176 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(pm.get()); |
| 177 |
4/5✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
|
10 | if ((curveQ = powerModule().efficiencyCurve())) { |
| 178 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveQ.get()); |
| 179 | } | ||
| 180 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
|
10 | if ((curveQ = powerModule().skinLossQuadraticCurve())) { |
| 181 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveQ.get()); |
| 182 | } | ||
| 183 | 5 | } | |
| 184 | |||
| 185 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelCellAirSupply> as = airSupply()) { |
| 186 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(as.get()); |
| 187 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
|
10 | if ((curveC = airSupply().blowerPowerCurve())) { |
| 188 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveC.get()); |
| 189 | } | ||
| 190 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
|
10 | if ((curveQ = airSupply().airRateFunctionofElectricPowerCurve())) { |
| 191 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveQ.get()); |
| 192 | } | ||
| 193 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
|
10 | if ((curveQ = airSupply().airRateFunctionofFuelRateCurve())) { |
| 194 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveQ.get()); |
| 195 | } | ||
| 196 | 5 | } | |
| 197 | |||
| 198 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelCellWaterSupply> ws = waterSupply()) { |
| 199 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(ws.get()); |
| 200 |
4/5✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
|
10 | if ((curveC = waterSupply().reformerWaterPumpPowerFunctionofFuelRateCurve())) { |
| 201 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveC.get()); |
| 202 | } | ||
| 203 |
4/5✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
|
10 | if ((curveQ = waterSupply().reformerWaterFlowRateFunctionofFuelRateCurve())) { |
| 204 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveQ.get()); |
| 205 | } | ||
| 206 | 5 | } | |
| 207 | |||
| 208 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelCellAuxiliaryHeater> ht = auxiliaryHeater()) { |
| 209 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(ht.get()); |
| 210 | 5 | } | |
| 211 | |||
| 212 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelCellElectricalStorage> es = electricalStorage()) { |
| 213 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(es.get()); |
| 214 | 5 | } | |
| 215 | |||
| 216 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelCellInverter> in = inverter()) { |
| 217 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(in.get()); |
| 218 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 9 taken 5 times.
✗ Branch 10 not taken.
|
10 | if ((curveQ = inverter().efficiencyFunctionofDCPowerCurve())) { |
| 219 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveQ.get()); |
| 220 | } | ||
| 221 | 5 | } | |
| 222 | |||
| 223 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
|
10 | if (boost::optional<GeneratorFuelCellStackCooler> sc = stackCooler()) { |
| 224 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result.push_back(sc.get()); |
| 225 | 5 | } | |
| 226 | |||
| 227 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<GeneratorFuelSupply> fs = fuelSupply()) { |
| 228 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(fs.get()); |
| 229 |
4/5✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
|
10 | if ((curveC = fuelSupply().compressorPowerMultiplierFunctionofFuelRateCurve())) { |
| 230 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | result.push_back(curveC.get()); |
| 231 | } | ||
| 232 | 5 | } | |
| 233 | |||
| 234 | 10 | return result; | |
| 235 | 5 | } | |
| 236 | |||
| 237 | ✗ | std::vector<ScheduleTypeKey> GeneratorFuelCell_Impl::getScheduleTypeKeys(const Schedule& /*schedule*/) const { | |
| 238 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 239 | ✗ | return result; | |
| 240 | } | ||
| 241 | |||
| 242 | // translated to ElectricLoadCenter:Generators 'Generator Rated Electric Power Output' | ||
| 243 | 3 | boost::optional<double> GeneratorFuelCell_Impl::ratedElectricPowerOutput() const { | |
| 244 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | return this->powerModule().nominalElectricalPower(); |
| 245 | } | ||
| 246 | |||
| 247 | 3 | boost::optional<Schedule> GeneratorFuelCell_Impl::availabilitySchedule() const { | |
| 248 | 3 | boost::optional<Schedule> schedule; | |
| 249 | 3 | return schedule; | |
| 250 | } | ||
| 251 | |||
| 252 | // Convenience method to go fetch the connected GeneratorFuelCell's 'Rated Thermal to Electrical Power Ratio' | ||
| 253 | 3 | boost::optional<double> GeneratorFuelCell_Impl::ratedThermaltoElectricalPowerRatio() const { | |
| 254 | 3 | boost::optional<double> temp; | |
| 255 | 3 | return temp; | |
| 256 | } | ||
| 257 | |||
| 258 | 25 | GeneratorFuelCellPowerModule GeneratorFuelCell_Impl::powerModule() const { | |
| 259 |
1/1✓ Branch 1 taken 25 times.
|
25 | boost::optional<GeneratorFuelCellPowerModule> value = optionalPowerModule(); |
| 260 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
|
25 | if (!value) { |
| 261 | ✗ | LOG_AND_THROW(" does not have an Power Module attached."); | |
| 262 | } | ||
| 263 |
2/2✓ Branch 1 taken 25 times.
✓ Branch 4 taken 25 times.
|
50 | return value.get(); |
| 264 | 25 | } | |
| 265 | |||
| 266 | 27 | GeneratorFuelCellAirSupply GeneratorFuelCell_Impl::airSupply() const { | |
| 267 |
1/1✓ Branch 1 taken 27 times.
|
27 | boost::optional<GeneratorFuelCellAirSupply> value = optionalAirSupply(); |
| 268 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
|
27 | if (!value) { |
| 269 | ✗ | LOG_AND_THROW(" does not have an Air Supply attached."); | |
| 270 | } | ||
| 271 |
2/2✓ Branch 1 taken 27 times.
✓ Branch 4 taken 27 times.
|
54 | return value.get(); |
| 272 | 27 | } | |
| 273 | |||
| 274 | 17 | GeneratorFuelSupply GeneratorFuelCell_Impl::fuelSupply() const { | |
| 275 |
1/1✓ Branch 1 taken 17 times.
|
17 | boost::optional<GeneratorFuelSupply> value = optionalFuelSupply(); |
| 276 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
|
17 | if (!value) { |
| 277 | ✗ | LOG_AND_THROW(" does not have an Fuel Supply attached."); | |
| 278 | } | ||
| 279 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
34 | return value.get(); |
| 280 | 17 | } | |
| 281 | |||
| 282 | 22 | GeneratorFuelCellWaterSupply GeneratorFuelCell_Impl::waterSupply() const { | |
| 283 |
1/1✓ Branch 1 taken 22 times.
|
22 | boost::optional<GeneratorFuelCellWaterSupply> value = optionalWaterSupply(); |
| 284 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 22 times.
|
22 | if (!value) { |
| 285 | ✗ | LOG_AND_THROW(" does not have an Water Supply attached."); | |
| 286 | } | ||
| 287 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
44 | return value.get(); |
| 288 | 22 | } | |
| 289 | |||
| 290 | 12 | GeneratorFuelCellAuxiliaryHeater GeneratorFuelCell_Impl::auxiliaryHeater() const { | |
| 291 |
1/1✓ Branch 1 taken 12 times.
|
12 | boost::optional<GeneratorFuelCellAuxiliaryHeater> value = optionalAuxiliaryHeater(); |
| 292 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
12 | if (!value) { |
| 293 | ✗ | LOG_AND_THROW(" does not have an Auxiliary Heater attached."); | |
| 294 | } | ||
| 295 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
24 | return value.get(); |
| 296 | 12 | } | |
| 297 | |||
| 298 | 7 | GeneratorFuelCellExhaustGasToWaterHeatExchanger GeneratorFuelCell_Impl::heatExchanger() const { | |
| 299 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<GeneratorFuelCellExhaustGasToWaterHeatExchanger> value = optionalHeatExchanger(); |
| 300 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
|
7 | if (!value) { |
| 301 | ✗ | LOG_AND_THROW(" does not have an Heat Exchanger attached."); | |
| 302 | } | ||
| 303 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
14 | return value.get(); |
| 304 | 7 | } | |
| 305 | |||
| 306 | 12 | GeneratorFuelCellElectricalStorage GeneratorFuelCell_Impl::electricalStorage() const { | |
| 307 |
1/1✓ Branch 1 taken 12 times.
|
12 | boost::optional<GeneratorFuelCellElectricalStorage> value = optionalElectricalStorage(); |
| 308 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
12 | if (!value) { |
| 309 | ✗ | LOG_AND_THROW(" does not have an Electrical Storage attached."); | |
| 310 | } | ||
| 311 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
24 | return value.get(); |
| 312 | 12 | } | |
| 313 | |||
| 314 | 17 | GeneratorFuelCellInverter GeneratorFuelCell_Impl::inverter() const { | |
| 315 |
1/1✓ Branch 1 taken 17 times.
|
17 | boost::optional<GeneratorFuelCellInverter> value = optionalInverter(); |
| 316 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
|
17 | if (!value) { |
| 317 | ✗ | LOG_AND_THROW(" does not have an Inverter attached."); | |
| 318 | } | ||
| 319 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
34 | return value.get(); |
| 320 | 17 | } | |
| 321 | |||
| 322 | 11 | boost::optional<GeneratorFuelCellStackCooler> GeneratorFuelCell_Impl::stackCooler() const { | |
| 323 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellStackCooler>(OS_Generator_FuelCellFields::StackCoolerName); |
| 324 | } | ||
| 325 | |||
| 326 | 8 | bool GeneratorFuelCell_Impl::setPowerModule(const GeneratorFuelCellPowerModule& fCPM) { | |
| 327 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::PowerModuleName, fCPM.handle()); |
| 328 | 8 | return result; | |
| 329 | } | ||
| 330 | |||
| 331 | 8 | bool GeneratorFuelCell_Impl::setAirSupply(const GeneratorFuelCellAirSupply& fCAirSup) { | |
| 332 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::AirSupplyName, fCAirSup.handle()); |
| 333 | 8 | return result; | |
| 334 | } | ||
| 335 | |||
| 336 | 8 | bool GeneratorFuelCell_Impl::setFuelSupply(const GeneratorFuelSupply& genFuelSup) { | |
| 337 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::FuelSupplyName, genFuelSup.handle()); |
| 338 | 8 | return result; | |
| 339 | } | ||
| 340 | |||
| 341 | 8 | bool GeneratorFuelCell_Impl::setWaterSupply(const GeneratorFuelCellWaterSupply& fCWaterSup) { | |
| 342 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::WaterSupplyName, fCWaterSup.handle()); |
| 343 | 8 | return result; | |
| 344 | } | ||
| 345 | |||
| 346 | 8 | bool GeneratorFuelCell_Impl::setAuxiliaryHeater(const GeneratorFuelCellAuxiliaryHeater& fCAuxHeat) { | |
| 347 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::AuxiliaryHeaterName, fCAuxHeat.handle()); |
| 348 | 8 | return result; | |
| 349 | } | ||
| 350 | |||
| 351 | 8 | bool GeneratorFuelCell_Impl::setHeatExchanger(const GeneratorFuelCellExhaustGasToWaterHeatExchanger& fCExhaustHX) { | |
| 352 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::HeatExchangerName, fCExhaustHX.handle()); |
| 353 | 8 | return result; | |
| 354 | } | ||
| 355 | |||
| 356 | 8 | bool GeneratorFuelCell_Impl::setElectricalStorage(const GeneratorFuelCellElectricalStorage& fCStorage) { | |
| 357 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::ElectricalStorageName, fCStorage.handle()); |
| 358 | 8 | return result; | |
| 359 | } | ||
| 360 | |||
| 361 | 8 | bool GeneratorFuelCell_Impl::setInverter(const GeneratorFuelCellInverter& fCInverter) { | |
| 362 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | bool result = setPointer(OS_Generator_FuelCellFields::InverterName, fCInverter.handle()); |
| 363 | 8 | return result; | |
| 364 | } | ||
| 365 | |||
| 366 | 1 | bool GeneratorFuelCell_Impl::setStackCooler(const GeneratorFuelCellStackCooler& fCStackCooler) { | |
| 367 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | bool result = setPointer(OS_Generator_FuelCellFields::StackCoolerName, fCStackCooler.handle()); |
| 368 | 1 | return result; | |
| 369 | } | ||
| 370 | |||
| 371 | ✗ | void GeneratorFuelCell_Impl::resetStackCooler() { | |
| 372 | ✗ | bool result = setString(OS_Generator_FuelCellFields::StackCoolerName, ""); | |
| 373 | ✗ | OS_ASSERT(result); | |
| 374 | ✗ | } | |
| 375 | |||
| 376 | 25 | boost::optional<GeneratorFuelCellPowerModule> GeneratorFuelCell_Impl::optionalPowerModule() const { | |
| 377 |
2/2✓ Branch 1 taken 25 times.
✓ Branch 4 taken 25 times.
|
25 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellPowerModule>(OS_Generator_FuelCellFields::PowerModuleName); |
| 378 | } | ||
| 379 | |||
| 380 | 27 | boost::optional<GeneratorFuelCellAirSupply> GeneratorFuelCell_Impl::optionalAirSupply() const { | |
| 381 |
2/2✓ Branch 1 taken 27 times.
✓ Branch 4 taken 27 times.
|
27 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellAirSupply>(OS_Generator_FuelCellFields::AirSupplyName); |
| 382 | } | ||
| 383 | |||
| 384 | 17 | boost::optional<GeneratorFuelSupply> GeneratorFuelCell_Impl::optionalFuelSupply() const { | |
| 385 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
17 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelSupply>(OS_Generator_FuelCellFields::FuelSupplyName); |
| 386 | } | ||
| 387 | |||
| 388 | 22 | boost::optional<GeneratorFuelCellWaterSupply> GeneratorFuelCell_Impl::optionalWaterSupply() const { | |
| 389 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellWaterSupply>(OS_Generator_FuelCellFields::WaterSupplyName); |
| 390 | } | ||
| 391 | |||
| 392 | 12 | boost::optional<GeneratorFuelCellAuxiliaryHeater> GeneratorFuelCell_Impl::optionalAuxiliaryHeater() const { | |
| 393 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellAuxiliaryHeater>(OS_Generator_FuelCellFields::AuxiliaryHeaterName); |
| 394 | } | ||
| 395 | |||
| 396 | 7 | boost::optional<GeneratorFuelCellExhaustGasToWaterHeatExchanger> GeneratorFuelCell_Impl::optionalHeatExchanger() const { | |
| 397 |
1/1✓ Branch 1 taken 7 times.
|
14 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellExhaustGasToWaterHeatExchanger>( |
| 398 |
1/1✓ Branch 1 taken 7 times.
|
14 | OS_Generator_FuelCellFields::HeatExchangerName); |
| 399 | } | ||
| 400 | |||
| 401 | 12 | boost::optional<GeneratorFuelCellElectricalStorage> GeneratorFuelCell_Impl::optionalElectricalStorage() const { | |
| 402 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellElectricalStorage>(OS_Generator_FuelCellFields::ElectricalStorageName); |
| 403 | } | ||
| 404 | |||
| 405 | 17 | boost::optional<GeneratorFuelCellInverter> GeneratorFuelCell_Impl::optionalInverter() const { | |
| 406 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
17 | return getObject<ModelObject>().getModelObjectTarget<GeneratorFuelCellInverter>(OS_Generator_FuelCellFields::InverterName); |
| 407 | } | ||
| 408 | |||
| 409 | } // namespace detail | ||
| 410 | |||
| 411 | 5 | GeneratorFuelCell::GeneratorFuelCell(const Model& model, const GeneratorFuelCellPowerModule& fCPM, const GeneratorFuelCellAirSupply& fCAS, | |
| 412 | const GeneratorFuelCellWaterSupply& fCWS, const GeneratorFuelCellAuxiliaryHeater& fCAH, | ||
| 413 | const GeneratorFuelCellExhaustGasToWaterHeatExchanger& fCExhaustHX, | ||
| 414 | const GeneratorFuelCellElectricalStorage& fCES, const GeneratorFuelCellInverter& fCInverter, | ||
| 415 | 5 | const GeneratorFuelSupply& fS) | |
| 416 | 5 | : Generator(GeneratorFuelCell::iddObjectType(), model) { | |
| 417 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 5 times.
✗ Branch 5 not taken.
|
5 | OS_ASSERT(getImpl<detail::GeneratorFuelCell_Impl>()); |
| 418 | |||
| 419 |
1/1✓ Branch 1 taken 5 times.
|
5 | bool ok = setPowerModule(fCPM); |
| 420 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 421 | ✗ | remove(); | |
| 422 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellPowerModule to " << fCPM.briefDescription() << "."); | |
| 423 | } | ||
| 424 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setAirSupply(fCAS); |
| 425 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 426 | ✗ | remove(); | |
| 427 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellAirSupply to " << fCAS.briefDescription() << "."); | |
| 428 | } | ||
| 429 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setFuelSupply(fS); |
| 430 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 431 | ✗ | remove(); | |
| 432 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelSupply to " << fS.briefDescription() << "."); | |
| 433 | } | ||
| 434 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setWaterSupply(fCWS); |
| 435 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 436 | ✗ | remove(); | |
| 437 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellWaterSupply to " << fCWS.briefDescription() << "."); | |
| 438 | } | ||
| 439 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setAuxiliaryHeater(fCAH); |
| 440 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 441 | ✗ | remove(); | |
| 442 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellAuxiliaryHeater to " << fCAH.briefDescription() << "."); | |
| 443 | } | ||
| 444 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setHeatExchanger(fCExhaustHX); |
| 445 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 446 | ✗ | remove(); | |
| 447 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellExhaustGasToWaterHeatExchanger to " | |
| 448 | << fCExhaustHX.briefDescription() << "."); | ||
| 449 | } | ||
| 450 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setElectricalStorage(fCES); |
| 451 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 452 | ✗ | remove(); | |
| 453 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellElectricalStorage to " << fCES.briefDescription() << "."); | |
| 454 | } | ||
| 455 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = setInverter(fCInverter); |
| 456 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (!ok) { |
| 457 | ✗ | remove(); | |
| 458 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellInverter to " << fCInverter.briefDescription() << "."); | |
| 459 | } | ||
| 460 | 5 | } | |
| 461 | |||
| 462 | 2 | GeneratorFuelCell::GeneratorFuelCell(const Model& model) : Generator(GeneratorFuelCell::iddObjectType(), model) { | |
| 463 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
|
2 | OS_ASSERT(getImpl<detail::GeneratorFuelCell_Impl>()); |
| 464 | |||
| 465 | //create generic FCPM | ||
| 466 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellPowerModule fCPM(model); |
| 467 |
1/1✓ Branch 1 taken 2 times.
|
2 | bool ok = setPowerModule(fCPM); |
| 468 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 469 | ✗ | remove(); | |
| 470 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellPowerModule"); | |
| 471 | } | ||
| 472 | //create generic FCAS | ||
| 473 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellAirSupply fCAS(model); |
| 474 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setAirSupply(fCAS); |
| 475 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 476 | ✗ | remove(); | |
| 477 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellAirSupply"); | |
| 478 | } | ||
| 479 | //create generic fuel supply | ||
| 480 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelSupply fS(model); |
| 481 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setFuelSupply(fS); |
| 482 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 483 | ✗ | remove(); | |
| 484 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelSupply"); | |
| 485 | } | ||
| 486 | //create generic water supply | ||
| 487 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellWaterSupply fCWS(model); |
| 488 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setWaterSupply(fCWS); |
| 489 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 490 | ✗ | remove(); | |
| 491 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellWaterSupply"); | |
| 492 | } | ||
| 493 | //create generic aux heater | ||
| 494 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellAuxiliaryHeater fCAH(model); |
| 495 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setAuxiliaryHeater(fCAH); |
| 496 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 497 | ✗ | remove(); | |
| 498 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellAuxiliaryHeater"); | |
| 499 | } | ||
| 500 | //create generic exhaust HX | ||
| 501 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellExhaustGasToWaterHeatExchanger fCExhaustHX(model); |
| 502 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setHeatExchanger(fCExhaustHX); |
| 503 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 504 | ✗ | remove(); | |
| 505 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellExhaustGasToWaterHeatExchanger"); | |
| 506 | } | ||
| 507 | //create generic storage | ||
| 508 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellElectricalStorage fCES(model); |
| 509 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setElectricalStorage(fCES); |
| 510 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 511 | ✗ | remove(); | |
| 512 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellElectricalStorage"); | |
| 513 | } | ||
| 514 | //create generic inverter | ||
| 515 |
1/1✓ Branch 1 taken 2 times.
|
2 | GeneratorFuelCellInverter fCInverter(model); |
| 516 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setInverter(fCInverter); |
| 517 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 518 | ✗ | remove(); | |
| 519 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s GeneratorFuelCellInverter"); | |
| 520 | } | ||
| 521 | 2 | } | |
| 522 | |||
| 523 | 7745 | IddObjectType GeneratorFuelCell::iddObjectType() { | |
| 524 |
1/1✓ Branch 1 taken 7745 times.
|
7745 | return {IddObjectType::OS_Generator_FuelCell}; |
| 525 | } | ||
| 526 | |||
| 527 | 6 | GeneratorFuelCellPowerModule GeneratorFuelCell::powerModule() const { | |
| 528 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->powerModule(); |
| 529 | } | ||
| 530 | |||
| 531 | 6 | GeneratorFuelCellAirSupply GeneratorFuelCell::airSupply() const { | |
| 532 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->airSupply(); |
| 533 | } | ||
| 534 | |||
| 535 | 6 | GeneratorFuelSupply GeneratorFuelCell::fuelSupply() const { | |
| 536 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->fuelSupply(); |
| 537 | } | ||
| 538 | |||
| 539 | 6 | GeneratorFuelCellWaterSupply GeneratorFuelCell::waterSupply() const { | |
| 540 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->waterSupply(); |
| 541 | } | ||
| 542 | |||
| 543 | 6 | GeneratorFuelCellAuxiliaryHeater GeneratorFuelCell::auxiliaryHeater() const { | |
| 544 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->auxiliaryHeater(); |
| 545 | } | ||
| 546 | |||
| 547 | 6 | GeneratorFuelCellExhaustGasToWaterHeatExchanger GeneratorFuelCell::heatExchanger() const { | |
| 548 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->heatExchanger(); |
| 549 | } | ||
| 550 | |||
| 551 | 6 | GeneratorFuelCellElectricalStorage GeneratorFuelCell::electricalStorage() const { | |
| 552 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->electricalStorage(); |
| 553 | } | ||
| 554 | |||
| 555 | 6 | GeneratorFuelCellInverter GeneratorFuelCell::inverter() const { | |
| 556 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCell_Impl>()->inverter(); |
| 557 | } | ||
| 558 | |||
| 559 | 5 | boost::optional<GeneratorFuelCellStackCooler> GeneratorFuelCell::stackCooler() const { | |
| 560 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::GeneratorFuelCell_Impl>()->stackCooler(); |
| 561 | } | ||
| 562 | |||
| 563 | 7 | bool GeneratorFuelCell::setPowerModule(const GeneratorFuelCellPowerModule& fCPM) { | |
| 564 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setPowerModule(fCPM); |
| 565 | } | ||
| 566 | |||
| 567 | 7 | bool GeneratorFuelCell::setAirSupply(const GeneratorFuelCellAirSupply& fCAirSup) { | |
| 568 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setAirSupply(fCAirSup); |
| 569 | } | ||
| 570 | |||
| 571 | 7 | bool GeneratorFuelCell::setFuelSupply(const GeneratorFuelSupply& genFuelSup) { | |
| 572 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setFuelSupply(genFuelSup); |
| 573 | } | ||
| 574 | |||
| 575 | 7 | bool GeneratorFuelCell::setWaterSupply(const GeneratorFuelCellWaterSupply& fCWaterSup) { | |
| 576 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setWaterSupply(fCWaterSup); |
| 577 | } | ||
| 578 | |||
| 579 | 7 | bool GeneratorFuelCell::setAuxiliaryHeater(const GeneratorFuelCellAuxiliaryHeater& fCAuxHeat) { | |
| 580 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setAuxiliaryHeater(fCAuxHeat); |
| 581 | } | ||
| 582 | |||
| 583 | 7 | bool GeneratorFuelCell::setHeatExchanger(const GeneratorFuelCellExhaustGasToWaterHeatExchanger& fCExhaustHX) { | |
| 584 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setHeatExchanger(fCExhaustHX); |
| 585 | } | ||
| 586 | |||
| 587 | 7 | bool GeneratorFuelCell::setElectricalStorage(const GeneratorFuelCellElectricalStorage& fCStorage) { | |
| 588 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setElectricalStorage(fCStorage); |
| 589 | } | ||
| 590 | |||
| 591 | 7 | bool GeneratorFuelCell::setInverter(const GeneratorFuelCellInverter& fCInverter) { | |
| 592 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCell_Impl>()->setInverter(fCInverter); |
| 593 | } | ||
| 594 | |||
| 595 | 1 | bool GeneratorFuelCell::setStackCooler(const GeneratorFuelCellStackCooler& fCStackCooler) { | |
| 596 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorFuelCell_Impl>()->setStackCooler(fCStackCooler); |
| 597 | } | ||
| 598 | |||
| 599 | ✗ | void GeneratorFuelCell::resetStackCooler() { | |
| 600 | ✗ | getImpl<detail::GeneratorFuelCell_Impl>()->resetStackCooler(); | |
| 601 | ✗ | } | |
| 602 | |||
| 603 | /// @cond | ||
| 604 |
1/1✓ Branch 3 taken 8 times.
|
8 | GeneratorFuelCell::GeneratorFuelCell(std::shared_ptr<detail::GeneratorFuelCell_Impl> impl) : Generator(std::move(impl)) {} |
| 605 | /// @endcond | ||
| 606 | |||
| 607 | } // namespace model | ||
| 608 | } // namespace openstudio | ||
| 609 |