src/model/GeneratorFuelCellAirSupply.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 "GeneratorFuelCellAirSupply.hpp" | ||
| 7 | #include "GeneratorFuelCellAirSupply_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model.hpp" | ||
| 10 | #include "Model_Impl.hpp" | ||
| 11 | |||
| 12 | #include "GeneratorFuelCell.hpp" | ||
| 13 | #include "GeneratorFuelCell_Impl.hpp" | ||
| 14 | |||
| 15 | #include "Node.hpp" | ||
| 16 | #include "Node_Impl.hpp" | ||
| 17 | #include "CurveCubic.hpp" | ||
| 18 | #include "CurveCubic_Impl.hpp" | ||
| 19 | #include "CurveQuadratic.hpp" | ||
| 20 | #include "CurveQuadratic_Impl.hpp" | ||
| 21 | |||
| 22 | #include <utilities/idd/IddFactory.hxx> | ||
| 23 | #include <utilities/idd/IddEnums.hxx> | ||
| 24 | #include <utilities/idd/OS_Generator_FuelCell_AirSupply_FieldEnums.hxx> | ||
| 25 | |||
| 26 | #include "../utilities/idf/WorkspaceExtensibleGroup.hpp" | ||
| 27 | |||
| 28 | #include "../utilities/units/Unit.hpp" | ||
| 29 | |||
| 30 | #include "../utilities/core/Assert.hpp" | ||
| 31 | |||
| 32 | namespace openstudio { | ||
| 33 | namespace model { | ||
| 34 | |||
| 35 | 8 | AirSupplyConstituent::AirSupplyConstituent(const std::string& constituentName, double molarFraction) | |
| 36 | 8 | : m_name(constituentName), m_molarFraction(molarFraction) { | |
| 37 | |||
| 38 |
2/4✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
|
8 | if ((m_molarFraction < 0) || (m_molarFraction > 1)) { |
| 39 | ✗ | LOG_AND_THROW("Unable to create constituent '" << m_name << "', molar fraction of " << m_molarFraction << " is outside the range [0, 1]"); | |
| 40 | } | ||
| 41 |
3/3✓ Branch 1 taken 8 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 7 times.
|
8 | if (!isValid(m_name)) { |
| 42 |
17/17✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 25 taken 1 time.
✓ Branch 28 taken 1 time.
✓ Branch 31 taken 1 time.
✓ Branch 34 taken 1 time.
✓ Branch 37 taken 1 time.
✓ Branch 40 taken 1 time.
✓ Branch 43 taken 1 time.
✓ Branch 46 taken 1 time.
✓ Branch 50 taken 1 time.
✓ Branch 53 taken 1 time.
|
1 | LOG_AND_THROW("ConstituentName '" << m_name << " is not valid. Check AirSupplyConstituent::constituentNameValues() to see possible names."); |
| 43 | } | ||
| 44 | 8 | } | |
| 45 | |||
| 46 | 6 | std::string AirSupplyConstituent::constituentName() const { | |
| 47 | 6 | return m_name; | |
| 48 | } | ||
| 49 | |||
| 50 | 6 | double AirSupplyConstituent::molarFraction() const { | |
| 51 | 6 | return m_molarFraction; | |
| 52 | } | ||
| 53 | |||
| 54 | 8 | bool AirSupplyConstituent::isValid(const std::string& constituentName) { | |
| 55 |
1/1✓ Branch 1 taken 8 times.
|
8 | std::vector<std::string> validConstituentNames = constituentNameValues(); |
| 56 |
1/1✓ Branch 3 taken 8 times.
|
8 | return std::find_if(validConstituentNames.begin(), validConstituentNames.end(), |
| 57 | 30 | [&constituentName](const auto& s) { return istringEqual(s, constituentName); }) | |
| 58 | 24 | != validConstituentNames.end(); | |
| 59 | 8 | } | |
| 60 | |||
| 61 | 8 | std::vector<std::string> AirSupplyConstituent::constituentNameValues() { | |
| 62 |
5/5✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
✓ Branch 13 taken 8 times.
|
8 | IddObject obj = IddFactory::instance().getObject(GeneratorFuelCellAirSupply::iddObjectType()).get(); |
| 63 | // Return IddKeyNames in extensible portion | ||
| 64 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
16 | return getIddKeyNames(obj, obj.numFields() + OS_Generator_FuelCell_AirSupplyExtensibleFields::ConstituentName); |
| 65 | 8 | } | |
| 66 | |||
| 67 | ✗ | std::vector<std::string> AirSupplyConstituent::validConstituentNameValues() { | |
| 68 | ✗ | return constituentNameValues(); | |
| 69 | } | ||
| 70 | |||
| 71 | ✗ | std::ostream& operator<<(std::ostream& out, const openstudio::model::AirSupplyConstituent& constituent) { | |
| 72 | ✗ | out << "name=" << constituent.constituentName() << ", molar fraction=" << constituent.molarFraction(); | |
| 73 | ✗ | return out; | |
| 74 | } | ||
| 75 | |||
| 76 | namespace detail { | ||
| 77 | |||
| 78 | 9 | GeneratorFuelCellAirSupply_Impl::GeneratorFuelCellAirSupply_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 79 | 9 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 80 |
4/6✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 9 times.
✗ Branch 13 not taken.
|
9 | OS_ASSERT(idfObject.iddObject().type() == GeneratorFuelCellAirSupply::iddObjectType()); |
| 81 | 9 | } | |
| 82 | |||
| 83 | ✗ | GeneratorFuelCellAirSupply_Impl::GeneratorFuelCellAirSupply_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 84 | ✗ | bool keepHandle) | |
| 85 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 86 | ✗ | OS_ASSERT(other.iddObject().type() == GeneratorFuelCellAirSupply::iddObjectType()); | |
| 87 | ✗ | } | |
| 88 | |||
| 89 | 6 | GeneratorFuelCellAirSupply_Impl::GeneratorFuelCellAirSupply_Impl(const GeneratorFuelCellAirSupply_Impl& other, Model_Impl* model, bool keepHandle) | |
| 90 | 6 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 91 | |||
| 92 | ✗ | const std::vector<std::string>& GeneratorFuelCellAirSupply_Impl::outputVariableNames() const { | |
| 93 | ✗ | static const std::vector<std::string> result; | |
| 94 | ✗ | return result; | |
| 95 | } | ||
| 96 | |||
| 97 | ✗ | IddObjectType GeneratorFuelCellAirSupply_Impl::iddObjectType() const { | |
| 98 | ✗ | return GeneratorFuelCellAirSupply::iddObjectType(); | |
| 99 | } | ||
| 100 | |||
| 101 | ✗ | std::vector<IddObjectType> GeneratorFuelCellAirSupply_Impl::allowableChildTypes() const { | |
| 102 | ✗ | std::vector<IddObjectType> result; | |
| 103 | ✗ | result.push_back(IddObjectType::OS_Curve_Cubic); | |
| 104 | ✗ | result.push_back(IddObjectType::OS_Curve_Quadratic); | |
| 105 | ✗ | return result; | |
| 106 | ✗ | } | |
| 107 | |||
| 108 | // Returns the children object | ||
| 109 | ✗ | std::vector<ModelObject> GeneratorFuelCellAirSupply_Impl::children() const { | |
| 110 | ✗ | std::vector<ModelObject> result; | |
| 111 | ✗ | boost::optional<CurveQuadratic> curveQ; | |
| 112 | ✗ | boost::optional<CurveCubic> curveC; | |
| 113 | |||
| 114 | ✗ | if ((curveC = blowerPowerCurve())) { | |
| 115 | ✗ | result.push_back(curveC.get()); | |
| 116 | } | ||
| 117 | ✗ | if ((curveQ = airRateFunctionofElectricPowerCurve())) { | |
| 118 | ✗ | result.push_back(curveQ.get()); | |
| 119 | } | ||
| 120 | ✗ | if ((curveQ = airRateFunctionofFuelRateCurve())) { | |
| 121 | ✗ | result.push_back(curveQ.get()); | |
| 122 | } | ||
| 123 | |||
| 124 | ✗ | return result; | |
| 125 | ✗ | } | |
| 126 | |||
| 127 | // Get the parent GeneratorFuelCell | ||
| 128 | ✗ | boost::optional<GeneratorFuelCell> GeneratorFuelCellAirSupply_Impl::fuelCell() const { | |
| 129 | |||
| 130 | ✗ | boost::optional<GeneratorFuelCell> fc; | |
| 131 | // We use getModelObjectSources to check if more than one | ||
| 132 | ✗ | std::vector<GeneratorFuelCell> fcs = getObject<ModelObject>().getModelObjectSources<GeneratorFuelCell>(GeneratorFuelCell::iddObjectType()); | |
| 133 | |||
| 134 | ✗ | if (!fcs.empty()) { | |
| 135 | ✗ | if (fcs.size() > 1u) { | |
| 136 | ✗ | LOG(Error, briefDescription() << " is referenced by more than one GeneratorFuelCell, returning the first"); | |
| 137 | } | ||
| 138 | ✗ | fc = fcs[0]; | |
| 139 | } | ||
| 140 | ✗ | return fc; | |
| 141 | ✗ | } | |
| 142 | |||
| 143 | 7 | boost::optional<Node> GeneratorFuelCellAirSupply_Impl::airInletNode() const { | |
| 144 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | return getObject<ModelObject>().getModelObjectTarget<Node>(OS_Generator_FuelCell_AirSupplyFields::AirInletNodeName); |
| 145 | } | ||
| 146 | |||
| 147 | 10 | boost::optional<CurveCubic> GeneratorFuelCellAirSupply_Impl::blowerPowerCurve() const { | |
| 148 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | return getObject<ModelObject>().getModelObjectTarget<CurveCubic>(OS_Generator_FuelCell_AirSupplyFields::BlowerPowerCurveName); |
| 149 | } | ||
| 150 | |||
| 151 | 4 | double GeneratorFuelCellAirSupply_Impl::blowerHeatLossFactor() const { | |
| 152 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_Generator_FuelCell_AirSupplyFields::BlowerHeatLossFactor, true); |
| 153 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if (!value) { |
| 154 | ✗ | LOG_AND_THROW(" does not have blowerHeatLossFactor."); | |
| 155 | } | ||
| 156 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 157 | } | ||
| 158 | |||
| 159 | 6 | std::string GeneratorFuelCellAirSupply_Impl::airSupplyRateCalculationMode() const { | |
| 160 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<std::string> value = getString(OS_Generator_FuelCell_AirSupplyFields::AirSupplyRateCalculationMode, true); |
| 161 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 162 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
12 | return value.get(); |
| 163 | 6 | } | |
| 164 | |||
| 165 | 6 | boost::optional<double> GeneratorFuelCellAirSupply_Impl::stoichiometricRatio() const { | |
| 166 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<double> value = getDouble(OS_Generator_FuelCell_AirSupplyFields::StoichiometricRatio, true); |
| 167 | 6 | return value; | |
| 168 | } | ||
| 169 | |||
| 170 | 14 | boost::optional<CurveQuadratic> GeneratorFuelCellAirSupply_Impl::airRateFunctionofElectricPowerCurve() const { | |
| 171 |
1/1✓ Branch 1 taken 14 times.
|
28 | return getObject<ModelObject>().getModelObjectTarget<CurveQuadratic>( |
| 172 |
1/1✓ Branch 1 taken 14 times.
|
28 | OS_Generator_FuelCell_AirSupplyFields::AirRateFunctionofElectricPowerCurveName); |
| 173 | } | ||
| 174 | |||
| 175 | 4 | boost::optional<double> GeneratorFuelCellAirSupply_Impl::airRateAirTemperatureCoefficient() const { | |
| 176 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_Generator_FuelCell_AirSupplyFields::AirRateAirTemperatureCoefficient, true); |
| 177 | 4 | return value; | |
| 178 | } | ||
| 179 | |||
| 180 | 8 | boost::optional<CurveQuadratic> GeneratorFuelCellAirSupply_Impl::airRateFunctionofFuelRateCurve() const { | |
| 181 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | return getObject<ModelObject>().getModelObjectTarget<CurveQuadratic>(OS_Generator_FuelCell_AirSupplyFields::AirRateFunctionofFuelRateCurveName); |
| 182 | } | ||
| 183 | |||
| 184 | 6 | std::string GeneratorFuelCellAirSupply_Impl::airIntakeHeatRecoveryMode() const { | |
| 185 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<std::string> value = getString(OS_Generator_FuelCell_AirSupplyFields::AirIntakeHeatRecoveryMode, true); |
| 186 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 187 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
12 | return value.get(); |
| 188 | 6 | } | |
| 189 | |||
| 190 | 6 | std::string GeneratorFuelCellAirSupply_Impl::airSupplyConstituentMode() const { | |
| 191 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<std::string> value = getString(OS_Generator_FuelCell_AirSupplyFields::AirSupplyConstituentMode, true); |
| 192 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 193 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
12 | return value.get(); |
| 194 | 6 | } | |
| 195 | |||
| 196 | 2 | bool GeneratorFuelCellAirSupply_Impl::setAirInletNode(const Node& connection) { | |
| 197 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | bool result = setPointer(OS_Generator_FuelCell_AirSupplyFields::AirInletNodeName, connection.handle()); |
| 198 | 2 | return result; | |
| 199 | } | ||
| 200 | |||
| 201 | 1 | void GeneratorFuelCellAirSupply_Impl::resetAirInletNode() { | |
| 202 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::AirInletNodeName, ""); |
| 203 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 204 | 1 | } | |
| 205 | |||
| 206 | 10 | bool GeneratorFuelCellAirSupply_Impl::setBlowerPowerCurve(const CurveCubic& cubicCurves) { | |
| 207 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | bool result = setPointer(OS_Generator_FuelCell_AirSupplyFields::BlowerPowerCurveName, cubicCurves.handle()); |
| 208 | 10 | return result; | |
| 209 | } | ||
| 210 | |||
| 211 | 1 | void GeneratorFuelCellAirSupply_Impl::resetBlowerPowerCurve() { | |
| 212 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::BlowerPowerCurveName, ""); |
| 213 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 214 | 1 | } | |
| 215 | |||
| 216 | 9 | bool GeneratorFuelCellAirSupply_Impl::setBlowerHeatLossFactor(double blowerHeatLossFactor) { | |
| 217 | 9 | bool result = setDouble(OS_Generator_FuelCell_AirSupplyFields::BlowerHeatLossFactor, blowerHeatLossFactor); | |
| 218 | 9 | return result; | |
| 219 | } | ||
| 220 | |||
| 221 | ✗ | void GeneratorFuelCellAirSupply_Impl::resetBlowerHeatLossFactor() { | |
| 222 | ✗ | bool result = setDouble(OS_Generator_FuelCell_AirSupplyFields::BlowerHeatLossFactor, 0); | |
| 223 | ✗ | OS_ASSERT(result); | |
| 224 | ✗ | } | |
| 225 | |||
| 226 | 9 | bool GeneratorFuelCellAirSupply_Impl::setAirSupplyRateCalculationMode(const std::string& airSupplyRateCalculationMode) { | |
| 227 | 9 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::AirSupplyRateCalculationMode, airSupplyRateCalculationMode); | |
| 228 | 9 | return result; | |
| 229 | } | ||
| 230 | |||
| 231 | 9 | bool GeneratorFuelCellAirSupply_Impl::setStoichiometricRatio(double stoichiometricRatio) { | |
| 232 | 9 | bool result = setDouble(OS_Generator_FuelCell_AirSupplyFields::StoichiometricRatio, stoichiometricRatio); | |
| 233 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | OS_ASSERT(result); |
| 234 | 9 | return result; | |
| 235 | } | ||
| 236 | |||
| 237 | ✗ | void GeneratorFuelCellAirSupply_Impl::resetStoichiometricRatio() { | |
| 238 | ✗ | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::StoichiometricRatio, ""); | |
| 239 | ✗ | OS_ASSERT(result); | |
| 240 | ✗ | } | |
| 241 | |||
| 242 | 9 | bool GeneratorFuelCellAirSupply_Impl::setAirRateFunctionofElectricPowerCurve(const CurveQuadratic& quadraticCurves) { | |
| 243 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | bool result = setPointer(OS_Generator_FuelCell_AirSupplyFields::AirRateFunctionofElectricPowerCurveName, quadraticCurves.handle()); |
| 244 | 9 | return result; | |
| 245 | } | ||
| 246 | |||
| 247 | 1 | void GeneratorFuelCellAirSupply_Impl::resetAirRateFunctionofElectricPowerCurve() { | |
| 248 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::AirRateFunctionofElectricPowerCurveName, ""); |
| 249 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 250 | 1 | } | |
| 251 | |||
| 252 | 9 | bool GeneratorFuelCellAirSupply_Impl::setAirRateAirTemperatureCoefficient(double airRateAirTemperatureCoefficient) { | |
| 253 | 9 | bool result = setDouble(OS_Generator_FuelCell_AirSupplyFields::AirRateAirTemperatureCoefficient, airRateAirTemperatureCoefficient); | |
| 254 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | OS_ASSERT(result); |
| 255 | 9 | return result; | |
| 256 | } | ||
| 257 | |||
| 258 | ✗ | void GeneratorFuelCellAirSupply_Impl::resetAirRateAirTemperatureCoefficient() { | |
| 259 | ✗ | bool result = setDouble(OS_Generator_FuelCell_AirSupplyFields::AirRateAirTemperatureCoefficient, 0); | |
| 260 | ✗ | OS_ASSERT(result); | |
| 261 | ✗ | } | |
| 262 | |||
| 263 | 9 | bool GeneratorFuelCellAirSupply_Impl::setAirRateFunctionofFuelRateCurve(const CurveQuadratic& quadraticCurves) { | |
| 264 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | bool result = setPointer(OS_Generator_FuelCell_AirSupplyFields::AirRateFunctionofFuelRateCurveName, quadraticCurves.handle()); |
| 265 | 9 | return result; | |
| 266 | } | ||
| 267 | |||
| 268 | 1 | void GeneratorFuelCellAirSupply_Impl::resetAirRateFunctionofFuelRateCurve() { | |
| 269 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::AirRateFunctionofFuelRateCurveName, ""); |
| 270 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 271 | 1 | } | |
| 272 | |||
| 273 | 9 | bool GeneratorFuelCellAirSupply_Impl::setAirIntakeHeatRecoveryMode(const std::string& airIntakeHeatRecoveryMode) { | |
| 274 | 9 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::AirIntakeHeatRecoveryMode, airIntakeHeatRecoveryMode); | |
| 275 | 9 | return result; | |
| 276 | } | ||
| 277 | |||
| 278 | 9 | bool GeneratorFuelCellAirSupply_Impl::setAirSupplyConstituentMode(const std::string& airSupplyConstituentMode) { | |
| 279 | 9 | bool result = setString(OS_Generator_FuelCell_AirSupplyFields::AirSupplyConstituentMode, airSupplyConstituentMode); | |
| 280 | 9 | return result; | |
| 281 | } | ||
| 282 | |||
| 283 | // TODO: this field shouldn't even exist in the IDD | ||
| 284 | 19 | unsigned int GeneratorFuelCellAirSupply_Impl::numberofUserDefinedConstituents() const { | |
| 285 | 19 | return numExtensibleGroups(); | |
| 286 | } | ||
| 287 | |||
| 288 | // TODO: this shouldn't even exist in IDD | ||
| 289 | 7 | bool GeneratorFuelCellAirSupply_Impl::setNumberofUserDefinedConstituents(unsigned int numberofUserDefinedConstituents) { | |
| 290 | 7 | bool result = setInt(OS_Generator_FuelCell_AirSupplyFields::NumberofUserDefinedConstituents, numberofUserDefinedConstituents); | |
| 291 | 7 | return result; | |
| 292 | } | ||
| 293 | |||
| 294 | // TODO: this shouldn't even exist in IDD | ||
| 295 | 1 | void GeneratorFuelCellAirSupply_Impl::resetNumberofUserDefinedConstituents() { | |
| 296 | 1 | bool result = setInt(OS_Generator_FuelCell_AirSupplyFields::NumberofUserDefinedConstituents, 0); | |
| 297 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 298 | 1 | } | |
| 299 | |||
| 300 | ✗ | double GeneratorFuelCellAirSupply_Impl::sumofConstituentsMolarFractions() const { | |
| 301 | ✗ | double result = 0; | |
| 302 | ✗ | if (numberofUserDefinedConstituents() == 0) { | |
| 303 | ✗ | LOG(Warn, briefDescription() << " does not have any constituents"); | |
| 304 | } else { | ||
| 305 | ✗ | for (const AirSupplyConstituent& constituent : constituents()) { | |
| 306 | ✗ | result += constituent.molarFraction(); | |
| 307 | ✗ | } | |
| 308 | } | ||
| 309 | |||
| 310 | ✗ | return result; | |
| 311 | } | ||
| 312 | |||
| 313 | 7 | bool GeneratorFuelCellAirSupply_Impl::addConstituent(const AirSupplyConstituent& constituent) { | |
| 314 | |||
| 315 | bool result; | ||
| 316 | |||
| 317 | 7 | unsigned int num = numberofUserDefinedConstituents(); | |
| 318 | // Max number of constituents is 5 | ||
| 319 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 6 times.
|
7 | if (num >= 5) { |
| 320 |
7/7✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
|
1 | LOG(Warn, briefDescription() << " already has 5 constituents which is the limit"); |
| 321 | 1 | result = false; | |
| 322 | } else { | ||
| 323 | // Push an extensible group | ||
| 324 |
3/3✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
6 | auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); |
| 325 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | bool temp = eg.setString(OS_Generator_FuelCell_AirSupplyExtensibleFields::ConstituentName, constituent.constituentName()); |
| 326 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | bool ok = eg.setDouble(OS_Generator_FuelCell_AirSupplyExtensibleFields::MolarFraction, constituent.molarFraction()); |
| 327 |
2/4✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
6 | if (temp && ok) { |
| 328 |
1/1✓ Branch 1 taken 6 times.
|
6 | setNumberofUserDefinedConstituents(num + 1); |
| 329 | 6 | result = true; | |
| 330 | } else { | ||
| 331 | // Something went wrong, probably the constituent name isn't in the list of possible choices | ||
| 332 | // So erase the new extensible group | ||
| 333 | ✗ | getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); | |
| 334 | ✗ | result = false; | |
| 335 | } | ||
| 336 | 6 | } | |
| 337 | 7 | return result; | |
| 338 | } | ||
| 339 | |||
| 340 | 8 | bool GeneratorFuelCellAirSupply_Impl::addConstituent(const std::string& name, double molarFraction) { | |
| 341 | // Make a constituent (which will check for validity), and then call the above function | ||
| 342 |
1/1✓ Branch 1 taken 7 times.
|
8 | AirSupplyConstituent constituent(name, molarFraction); |
| 343 |
1/1✓ Branch 1 taken 7 times.
|
14 | return addConstituent(constituent); |
| 344 | 7 | } | |
| 345 | |||
| 346 | 2 | bool GeneratorFuelCellAirSupply_Impl::removeConstituent(unsigned groupIndex) { | |
| 347 | bool result; | ||
| 348 | |||
| 349 | 2 | unsigned int num = numberofUserDefinedConstituents(); | |
| 350 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (groupIndex < num) { |
| 351 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | getObject<ModelObject>().eraseExtensibleGroup(groupIndex); |
| 352 | 1 | setNumberofUserDefinedConstituents(num - 1); | |
| 353 | 1 | result = true; | |
| 354 | } else { | ||
| 355 | 1 | result = false; | |
| 356 | } | ||
| 357 | 2 | return result; | |
| 358 | } | ||
| 359 | |||
| 360 | 1 | void GeneratorFuelCellAirSupply_Impl::removeAllConstituents() { | |
| 361 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | getObject<ModelObject>().clearExtensibleGroups(); |
| 362 | 1 | resetNumberofUserDefinedConstituents(); | |
| 363 | 1 | } | |
| 364 | |||
| 365 | 3 | std::vector<AirSupplyConstituent> GeneratorFuelCellAirSupply_Impl::constituents() const { | |
| 366 | 3 | std::vector<AirSupplyConstituent> result; | |
| 367 | |||
| 368 |
1/1✓ Branch 1 taken 3 times.
|
3 | std::vector<IdfExtensibleGroup> groups = extensibleGroups(); |
| 369 | |||
| 370 |
1/2✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
|
3 | for (const auto& group : groups) { |
| 371 | boost::optional<std::string> name = | ||
| 372 | ✗ | group.cast<WorkspaceExtensibleGroup>().getString(OS_Generator_FuelCell_AirSupplyExtensibleFields::ConstituentName); | |
| 373 | boost::optional<double> molarFraction = | ||
| 374 | ✗ | group.cast<WorkspaceExtensibleGroup>().getDouble(OS_Generator_FuelCell_AirSupplyExtensibleFields::MolarFraction); | |
| 375 | |||
| 376 | ✗ | if (name && molarFraction) { | |
| 377 | ✗ | AirSupplyConstituent constituent(name.get(), molarFraction.get()); | |
| 378 | ✗ | result.push_back(constituent); | |
| 379 | ✗ | } | |
| 380 | ✗ | } | |
| 381 | |||
| 382 | 6 | return result; | |
| 383 | 3 | } | |
| 384 | |||
| 385 | } // namespace detail | ||
| 386 | |||
| 387 | ✗ | GeneratorFuelCellAirSupply::GeneratorFuelCellAirSupply(const Model& model, const Node& airInletNode, const CurveQuadratic& electricPowerCurve, | |
| 388 | ✗ | const CurveQuadratic& fuelRateCurve, const CurveCubic& blowerPowerCurve) | |
| 389 | ✗ | : ModelObject(GeneratorFuelCellAirSupply::iddObjectType(), model) { | |
| 390 | ✗ | OS_ASSERT(getImpl<detail::GeneratorFuelCellAirSupply_Impl>()); | |
| 391 | |||
| 392 | ✗ | bool ok = setAirInletNode(airInletNode); | |
| 393 | ✗ | if (!ok) { | |
| 394 | ✗ | remove(); | |
| 395 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s airInletNode to " << airInletNode.briefDescription() << "."); | |
| 396 | } | ||
| 397 | |||
| 398 | ✗ | ok = setBlowerPowerCurve(blowerPowerCurve); | |
| 399 | ✗ | if (!ok) { | |
| 400 | ✗ | remove(); | |
| 401 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s blowerPowerCurve to " << blowerPowerCurve.briefDescription() << "."); | |
| 402 | } | ||
| 403 | |||
| 404 | ✗ | setBlowerHeatLossFactor(1.0); | |
| 405 | ✗ | setAirSupplyRateCalculationMode("AirRatiobyStoics"); | |
| 406 | ✗ | setStoichiometricRatio(1.0); | |
| 407 | |||
| 408 | ✗ | setAirRateFunctionofElectricPowerCurve(electricPowerCurve); | |
| 409 | ✗ | setAirRateAirTemperatureCoefficient(0.00283); | |
| 410 | |||
| 411 | ✗ | setAirRateFunctionofFuelRateCurve(fuelRateCurve); | |
| 412 | ✗ | setAirIntakeHeatRecoveryMode("NoRecovery"); | |
| 413 | ✗ | setAirSupplyConstituentMode("AmbientAir"); | |
| 414 | ✗ | } | |
| 415 | |||
| 416 | ✗ | GeneratorFuelCellAirSupply::GeneratorFuelCellAirSupply(const Model& model, const Node& airInletNode, const CurveQuadratic& electricPowerCurve, | |
| 417 | ✗ | const CurveQuadratic& fuelRateCurve) | |
| 418 | ✗ | : ModelObject(GeneratorFuelCellAirSupply::iddObjectType(), model) { | |
| 419 | ✗ | OS_ASSERT(getImpl<detail::GeneratorFuelCellAirSupply_Impl>()); | |
| 420 | |||
| 421 | ✗ | bool ok = setAirInletNode(airInletNode); | |
| 422 | ✗ | if (!ok) { | |
| 423 | ✗ | remove(); | |
| 424 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s airInletNode to " << airInletNode.briefDescription() << "."); | |
| 425 | } | ||
| 426 | |||
| 427 | ✗ | CurveCubic curveCubic(model); | |
| 428 | ✗ | curveCubic.setCoefficient1Constant(0); | |
| 429 | ✗ | curveCubic.setCoefficient2x(0); | |
| 430 | ✗ | curveCubic.setCoefficient3xPOW2(0); | |
| 431 | ✗ | curveCubic.setCoefficient4xPOW3(0); | |
| 432 | ✗ | curveCubic.setMinimumValueofx(-1.0e10); | |
| 433 | ✗ | curveCubic.setMaximumValueofx(1.0e10); | |
| 434 | ✗ | ok = setBlowerPowerCurve(curveCubic); | |
| 435 | ✗ | if (!ok) { | |
| 436 | ✗ | remove(); | |
| 437 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s setBlowerPowerCurve to " << curveCubic.briefDescription() << "."); | |
| 438 | } | ||
| 439 | |||
| 440 | ✗ | setBlowerHeatLossFactor(1.0); | |
| 441 | ✗ | setAirSupplyRateCalculationMode("AirRatiobyStoics"); | |
| 442 | ✗ | setStoichiometricRatio(1.0); | |
| 443 | |||
| 444 | ✗ | ok = setAirRateFunctionofElectricPowerCurve(electricPowerCurve); | |
| 445 | ✗ | if (!ok) { | |
| 446 | ✗ | remove(); | |
| 447 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s electricPowerCurve to " << electricPowerCurve.briefDescription() << "."); | |
| 448 | } | ||
| 449 | ✗ | setAirRateAirTemperatureCoefficient(0.00283); | |
| 450 | |||
| 451 | ✗ | ok = setAirRateFunctionofFuelRateCurve(fuelRateCurve); | |
| 452 | ✗ | if (!ok) { | |
| 453 | ✗ | remove(); | |
| 454 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s fuelRateCurve to " << fuelRateCurve.briefDescription() << "."); | |
| 455 | } | ||
| 456 | ✗ | setAirIntakeHeatRecoveryMode("NoRecovery"); | |
| 457 | ✗ | setAirSupplyConstituentMode("AmbientAir"); | |
| 458 | ✗ | } | |
| 459 | |||
| 460 | 1 | GeneratorFuelCellAirSupply::GeneratorFuelCellAirSupply(const Model& model, const Node& airInletNode) | |
| 461 | 1 | : ModelObject(GeneratorFuelCellAirSupply::iddObjectType(), model) { | |
| 462 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::GeneratorFuelCellAirSupply_Impl>()); |
| 463 | |||
| 464 |
1/1✓ Branch 1 taken 1 time.
|
1 | bool ok = setAirInletNode(airInletNode); |
| 465 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!ok) { |
| 466 | ✗ | remove(); | |
| 467 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s airInletNode to " << airInletNode.briefDescription() << "."); | |
| 468 | } | ||
| 469 | |||
| 470 |
1/1✓ Branch 1 taken 1 time.
|
1 | CurveCubic curveCubic(model); |
| 471 |
1/1✓ Branch 1 taken 1 time.
|
1 | curveCubic.setCoefficient1Constant(0); |
| 472 |
1/1✓ Branch 1 taken 1 time.
|
1 | curveCubic.setCoefficient2x(0); |
| 473 |
1/1✓ Branch 1 taken 1 time.
|
1 | curveCubic.setCoefficient3xPOW2(0); |
| 474 |
1/1✓ Branch 1 taken 1 time.
|
1 | curveCubic.setCoefficient4xPOW3(0); |
| 475 |
1/1✓ Branch 1 taken 1 time.
|
1 | curveCubic.setMinimumValueofx(-1.0e10); |
| 476 |
1/1✓ Branch 1 taken 1 time.
|
1 | curveCubic.setMaximumValueofx(1.0e10); |
| 477 |
1/1✓ Branch 1 taken 1 time.
|
1 | ok = setBlowerPowerCurve(curveCubic); |
| 478 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!ok) { |
| 479 | ✗ | remove(); | |
| 480 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s setBlowerPowerCurve to " << curveCubic.briefDescription() << "."); | |
| 481 | } | ||
| 482 | |||
| 483 |
1/1✓ Branch 1 taken 1 time.
|
1 | setBlowerHeatLossFactor(1.0); |
| 484 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | setAirSupplyRateCalculationMode("AirRatiobyStoics"); |
| 485 |
1/1✓ Branch 1 taken 1 time.
|
1 | setStoichiometricRatio(1.0); |
| 486 | |||
| 487 |
1/1✓ Branch 1 taken 1 time.
|
1 | setAirRateAirTemperatureCoefficient(0.00283); |
| 488 | |||
| 489 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | setAirIntakeHeatRecoveryMode("NoRecovery"); |
| 490 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | setAirSupplyConstituentMode("AmbientAir"); |
| 491 | 1 | } | |
| 492 | |||
| 493 | 8 | GeneratorFuelCellAirSupply::GeneratorFuelCellAirSupply(const Model& model) : ModelObject(GeneratorFuelCellAirSupply::iddObjectType(), model) { | |
| 494 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
✗ Branch 5 not taken.
|
8 | OS_ASSERT(getImpl<detail::GeneratorFuelCellAirSupply_Impl>()); |
| 495 | //setAirInletNode(); //A new OA node is created on Forward Translation if one is not set, so this method can be left blank | ||
| 496 |
1/1✓ Branch 1 taken 8 times.
|
8 | CurveCubic curveCubic(model); |
| 497 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveCubic.setCoefficient1Constant(0); |
| 498 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveCubic.setCoefficient2x(0); |
| 499 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveCubic.setCoefficient3xPOW2(0); |
| 500 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveCubic.setCoefficient4xPOW3(0); |
| 501 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveCubic.setMinimumValueofx(-1.0e10); |
| 502 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveCubic.setMaximumValueofx(1.0e10); |
| 503 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | curveCubic.setName("Blower Power Curve"); |
| 504 |
1/1✓ Branch 1 taken 8 times.
|
8 | bool ok = setBlowerPowerCurve(curveCubic); |
| 505 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
8 | if (!ok) { |
| 506 | ✗ | remove(); | |
| 507 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s setBlowerPowerCurve to " << curveCubic.briefDescription() << "."); | |
| 508 | } | ||
| 509 | |||
| 510 |
1/1✓ Branch 1 taken 8 times.
|
8 | setBlowerHeatLossFactor(1.0); |
| 511 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | setAirSupplyRateCalculationMode("AirRatiobyStoics"); |
| 512 |
1/1✓ Branch 1 taken 8 times.
|
8 | setStoichiometricRatio(1.0); |
| 513 |
1/1✓ Branch 1 taken 8 times.
|
8 | setAirRateAirTemperatureCoefficient(0.00283); |
| 514 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
16 | setAirIntakeHeatRecoveryMode("NoRecovery"); |
| 515 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | setAirSupplyConstituentMode("AmbientAir"); |
| 516 | |||
| 517 |
1/1✓ Branch 1 taken 8 times.
|
8 | CurveQuadratic curveQ(model); |
| 518 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ.setCoefficient1Constant(1.50976E-3); |
| 519 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ.setCoefficient2x(-7.76656E-7); |
| 520 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ.setCoefficient3xPOW2(1.30317E-10); |
| 521 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ.setMinimumValueofx(-1.0e10); |
| 522 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ.setMaximumValueofx(1.0e10); |
| 523 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | curveQ.setName("Air Rate Function of Electric Power Curve"); |
| 524 |
1/1✓ Branch 1 taken 8 times.
|
8 | ok = setAirRateFunctionofElectricPowerCurve(curveQ); |
| 525 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
8 | if (!ok) { |
| 526 | ✗ | remove(); | |
| 527 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s setBlowerPowerCurve to " << curveQ.briefDescription() << "."); | |
| 528 | } | ||
| 529 | |||
| 530 |
1/1✓ Branch 1 taken 8 times.
|
8 | CurveQuadratic curveQ2(model); |
| 531 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ2.setMinimumValueofx(-1.0e10); |
| 532 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ2.setMaximumValueofx(1.0e10); |
| 533 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ2.setCoefficient1Constant(0); |
| 534 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ2.setCoefficient2x(0); |
| 535 |
1/1✓ Branch 1 taken 8 times.
|
8 | curveQ2.setCoefficient3xPOW2(0); |
| 536 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | curveQ2.setName("Air Rate Function of Fuel Rate Curve"); |
| 537 |
1/1✓ Branch 1 taken 8 times.
|
8 | ok = setAirRateFunctionofFuelRateCurve(curveQ2); |
| 538 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
8 | if (!ok) { |
| 539 | ✗ | remove(); | |
| 540 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s setBlowerPowerCurve to " << curveQ2.briefDescription() << "."); | |
| 541 | } | ||
| 542 | 8 | } | |
| 543 | |||
| 544 | 7624 | IddObjectType GeneratorFuelCellAirSupply::iddObjectType() { | |
| 545 |
1/1✓ Branch 1 taken 7624 times.
|
7624 | return {IddObjectType::OS_Generator_FuelCell_AirSupply}; |
| 546 | } | ||
| 547 | |||
| 548 | ✗ | double GeneratorFuelCellAirSupply::sumofConstituentsMolarFractions() const { | |
| 549 | ✗ | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->sumofConstituentsMolarFractions(); | |
| 550 | } | ||
| 551 | |||
| 552 | ✗ | bool GeneratorFuelCellAirSupply::addConstituent(const AirSupplyConstituent& constituent) { | |
| 553 | ✗ | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->addConstituent(constituent); | |
| 554 | } | ||
| 555 | |||
| 556 | 8 | bool GeneratorFuelCellAirSupply::addConstituent(const std::string& name, double molarFraction) { | |
| 557 |
1/1✓ Branch 3 taken 7 times.
|
8 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->addConstituent(name, molarFraction); |
| 558 | } | ||
| 559 | |||
| 560 | // TODO: change to bool | ||
| 561 | 2 | void GeneratorFuelCellAirSupply::removeConstituent(int groupIndex) { | |
| 562 |
1/1✓ Branch 3 taken 2 times.
|
2 | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->removeConstituent(groupIndex); |
| 563 | 2 | } | |
| 564 | |||
| 565 | 1 | void GeneratorFuelCellAirSupply::removeAllConstituents() { | |
| 566 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->removeAllConstituents(); |
| 567 | } | ||
| 568 | |||
| 569 | 3 | std::vector<AirSupplyConstituent> GeneratorFuelCellAirSupply::constituents() const { | |
| 570 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->constituents(); |
| 571 | } | ||
| 572 | |||
| 573 | ✗ | std::vector<std::string> GeneratorFuelCellAirSupply::airSupplyRateCalculationModeValues() { | |
| 574 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), | |
| 575 | ✗ | OS_Generator_FuelCell_AirSupplyFields::AirSupplyRateCalculationMode); | |
| 576 | } | ||
| 577 | |||
| 578 | ✗ | std::vector<std::string> GeneratorFuelCellAirSupply::airIntakeHeatRecoveryModeValues() { | |
| 579 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Generator_FuelCell_AirSupplyFields::AirIntakeHeatRecoveryMode); | |
| 580 | } | ||
| 581 | |||
| 582 | ✗ | std::vector<std::string> GeneratorFuelCellAirSupply::airSupplyConstituentModeValues() { | |
| 583 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Generator_FuelCell_AirSupplyFields::AirSupplyConstituentMode); | |
| 584 | } | ||
| 585 | |||
| 586 | 7 | boost::optional<Node> GeneratorFuelCellAirSupply::airInletNode() const { | |
| 587 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airInletNode(); |
| 588 | } | ||
| 589 | |||
| 590 | 10 | boost::optional<CurveCubic> GeneratorFuelCellAirSupply::blowerPowerCurve() const { | |
| 591 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->blowerPowerCurve(); |
| 592 | } | ||
| 593 | |||
| 594 | 4 | double GeneratorFuelCellAirSupply::blowerHeatLossFactor() const { | |
| 595 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->blowerHeatLossFactor(); |
| 596 | } | ||
| 597 | |||
| 598 | 6 | std::string GeneratorFuelCellAirSupply::airSupplyRateCalculationMode() const { | |
| 599 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airSupplyRateCalculationMode(); |
| 600 | } | ||
| 601 | |||
| 602 | 6 | boost::optional<double> GeneratorFuelCellAirSupply::stoichiometricRatio() const { | |
| 603 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->stoichiometricRatio(); |
| 604 | } | ||
| 605 | |||
| 606 | 14 | boost::optional<CurveQuadratic> GeneratorFuelCellAirSupply::airRateFunctionofElectricPowerCurve() const { | |
| 607 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airRateFunctionofElectricPowerCurve(); |
| 608 | } | ||
| 609 | |||
| 610 | 4 | boost::optional<double> GeneratorFuelCellAirSupply::airRateAirTemperatureCoefficient() const { | |
| 611 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airRateAirTemperatureCoefficient(); |
| 612 | } | ||
| 613 | |||
| 614 | 8 | boost::optional<CurveQuadratic> GeneratorFuelCellAirSupply::airRateFunctionofFuelRateCurve() const { | |
| 615 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airRateFunctionofFuelRateCurve(); |
| 616 | } | ||
| 617 | |||
| 618 | 6 | std::string GeneratorFuelCellAirSupply::airIntakeHeatRecoveryMode() const { | |
| 619 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airIntakeHeatRecoveryMode(); |
| 620 | } | ||
| 621 | |||
| 622 | 6 | std::string GeneratorFuelCellAirSupply::airSupplyConstituentMode() const { | |
| 623 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->airSupplyConstituentMode(); |
| 624 | } | ||
| 625 | |||
| 626 | 10 | boost::optional<unsigned int> GeneratorFuelCellAirSupply::numberofUserDefinedConstituents() const { | |
| 627 |
2/2✓ Branch 3 taken 10 times.
✓ Branch 6 taken 10 times.
|
10 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->numberofUserDefinedConstituents(); |
| 628 | } | ||
| 629 | |||
| 630 | 2 | bool GeneratorFuelCellAirSupply::setAirInletNode(const Node& connection) { | |
| 631 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirInletNode(connection); |
| 632 | } | ||
| 633 | |||
| 634 | 1 | void GeneratorFuelCellAirSupply::resetAirInletNode() { | |
| 635 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetAirInletNode(); |
| 636 | 1 | } | |
| 637 | |||
| 638 | 10 | bool GeneratorFuelCellAirSupply::setBlowerPowerCurve(const CurveCubic& cubicCurves) { | |
| 639 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setBlowerPowerCurve(cubicCurves); |
| 640 | } | ||
| 641 | |||
| 642 | 1 | void GeneratorFuelCellAirSupply::resetBlowerPowerCurve() { | |
| 643 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetBlowerPowerCurve(); |
| 644 | 1 | } | |
| 645 | |||
| 646 | 9 | bool GeneratorFuelCellAirSupply::setBlowerHeatLossFactor(double blowerHeatLossFactor) { | |
| 647 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setBlowerHeatLossFactor(blowerHeatLossFactor); |
| 648 | } | ||
| 649 | |||
| 650 | ✗ | void GeneratorFuelCellAirSupply::resetBlowerHeatLossFactor() { | |
| 651 | ✗ | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetBlowerHeatLossFactor(); | |
| 652 | ✗ | } | |
| 653 | |||
| 654 | 9 | bool GeneratorFuelCellAirSupply::setAirSupplyRateCalculationMode(const std::string& airSupplyRateCalculationMode) { | |
| 655 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirSupplyRateCalculationMode(airSupplyRateCalculationMode); |
| 656 | } | ||
| 657 | |||
| 658 | 9 | bool GeneratorFuelCellAirSupply::setStoichiometricRatio(double stoichiometricRatio) { | |
| 659 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setStoichiometricRatio(stoichiometricRatio); |
| 660 | } | ||
| 661 | |||
| 662 | ✗ | void GeneratorFuelCellAirSupply::resetStoichiometricRatio() { | |
| 663 | ✗ | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetStoichiometricRatio(); | |
| 664 | ✗ | } | |
| 665 | |||
| 666 | 9 | bool GeneratorFuelCellAirSupply::setAirRateFunctionofElectricPowerCurve(const CurveQuadratic& quadraticCurves) { | |
| 667 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirRateFunctionofElectricPowerCurve(quadraticCurves); |
| 668 | } | ||
| 669 | |||
| 670 | 1 | void GeneratorFuelCellAirSupply::resetAirRateFunctionofElectricPowerCurve() { | |
| 671 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetAirRateFunctionofElectricPowerCurve(); |
| 672 | 1 | } | |
| 673 | |||
| 674 | 9 | bool GeneratorFuelCellAirSupply::setAirRateAirTemperatureCoefficient(double airRateAirTemperatureCoefficient) { | |
| 675 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirRateAirTemperatureCoefficient(airRateAirTemperatureCoefficient); |
| 676 | } | ||
| 677 | |||
| 678 | ✗ | void GeneratorFuelCellAirSupply::resetAirRateAirTemperatureCoefficient() { | |
| 679 | ✗ | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetAirRateAirTemperatureCoefficient(); | |
| 680 | ✗ | } | |
| 681 | |||
| 682 | 9 | bool GeneratorFuelCellAirSupply::setAirRateFunctionofFuelRateCurve(const CurveQuadratic& quadraticCurves) { | |
| 683 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirRateFunctionofFuelRateCurve(quadraticCurves); |
| 684 | } | ||
| 685 | |||
| 686 | 1 | void GeneratorFuelCellAirSupply::resetAirRateFunctionofFuelRateCurve() { | |
| 687 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->resetAirRateFunctionofFuelRateCurve(); |
| 688 | 1 | } | |
| 689 | |||
| 690 | 9 | bool GeneratorFuelCellAirSupply::setAirIntakeHeatRecoveryMode(const std::string& airIntakeHeatRecoveryMode) { | |
| 691 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirIntakeHeatRecoveryMode(airIntakeHeatRecoveryMode); |
| 692 | } | ||
| 693 | |||
| 694 | 9 | bool GeneratorFuelCellAirSupply::setAirSupplyConstituentMode(const std::string& airSupplyConstituentMode) { | |
| 695 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->setAirSupplyConstituentMode(airSupplyConstituentMode); |
| 696 | } | ||
| 697 | |||
| 698 | ✗ | boost::optional<GeneratorFuelCell> GeneratorFuelCellAirSupply::fuelCell() const { | |
| 699 | ✗ | return getImpl<detail::GeneratorFuelCellAirSupply_Impl>()->fuelCell(); | |
| 700 | } | ||
| 701 | |||
| 702 | /// @cond | ||
| 703 | 31 | GeneratorFuelCellAirSupply::GeneratorFuelCellAirSupply(std::shared_ptr<detail::GeneratorFuelCellAirSupply_Impl> impl) | |
| 704 |
1/1✓ Branch 3 taken 31 times.
|
31 | : ModelObject(std::move(impl)) {} |
| 705 | /// @endcond | ||
| 706 | |||
| 707 | } // namespace model | ||
| 708 | } // namespace openstudio | ||
| 709 |