src/model/GeneratorFuelCellAirSupply.hpp
| 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 | #ifndef MODEL_GENERATORFUELCELLAIRSUPPLY_HPP | ||
| 7 | #define MODEL_GENERATORFUELCELLAIRSUPPLY_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | namespace model { | ||
| 15 | |||
| 16 | class Node; | ||
| 17 | class CurveCubic; | ||
| 18 | class CurveQuadratic; | ||
| 19 | class GeneratorFuelCell; | ||
| 20 | |||
| 21 | /** This class implements a constituent */ | ||
| 22 | class MODEL_API AirSupplyConstituent | ||
| 23 | { | ||
| 24 | public: | ||
| 25 | AirSupplyConstituent(const std::string& constituentName, double molarFraction); | ||
| 26 | |||
| 27 | std::string constituentName() const; | ||
| 28 | double molarFraction() const; | ||
| 29 | |||
| 30 | static bool isValid(const std::string& constituentName); | ||
| 31 | static std::vector<std::string> constituentNameValues(); | ||
| 32 | static std::vector<std::string> validConstituentNameValues(); | ||
| 33 | |||
| 34 | private: | ||
| 35 | std::string m_name; | ||
| 36 | double m_molarFraction; | ||
| 37 | − | REGISTER_LOGGER("openstudio.model.AirSupplyConstituent"); | |
| 38 | }; | ||
| 39 | |||
| 40 | // Overload operator<< | ||
| 41 | MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::AirSupplyConstituent& constituent); | ||
| 42 | |||
| 43 | namespace detail { | ||
| 44 | |||
| 45 | class GeneratorFuelCellAirSupply_Impl; | ||
| 46 | |||
| 47 | } // namespace detail | ||
| 48 | |||
| 49 | /** GeneratorFuelCellAirSupply is a ModelObject that wraps the OpenStudio IDD object 'OS:Generator:FuelCell:AirSupply'. */ | ||
| 50 | class MODEL_API GeneratorFuelCellAirSupply : public ModelObject | ||
| 51 | { | ||
| 52 | public: | ||
| 53 | /** @name Constructors and Destructors */ | ||
| 54 | //@{ | ||
| 55 | |||
| 56 | explicit GeneratorFuelCellAirSupply(const Model& model); | ||
| 57 | |||
| 58 | explicit GeneratorFuelCellAirSupply(const Model& model, const Node& airInletNode); | ||
| 59 | |||
| 60 | explicit GeneratorFuelCellAirSupply(const Model& model, const Node& airInletNode, const CurveQuadratic& electricPowerCurve, | ||
| 61 | const CurveQuadratic& fuelRateCurve); | ||
| 62 | |||
| 63 | explicit GeneratorFuelCellAirSupply(const Model& model, const Node& airInletNode, const CurveQuadratic& electricPowerCurve, | ||
| 64 | const CurveQuadratic& fuelRateCurve, const CurveCubic& blowerPowerCurve); | ||
| 65 | |||
| 66 | 127 | virtual ~GeneratorFuelCellAirSupply() override = default; | |
| 67 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 68 | 27 | GeneratorFuelCellAirSupply(const GeneratorFuelCellAirSupply& other) = default; | |
| 69 | 60 | GeneratorFuelCellAirSupply(GeneratorFuelCellAirSupply&& other) = default; | |
| 70 | ✗ | GeneratorFuelCellAirSupply& operator=(const GeneratorFuelCellAirSupply&) = default; | |
| 71 | ✗ | GeneratorFuelCellAirSupply& operator=(GeneratorFuelCellAirSupply&&) = default; | |
| 72 | |||
| 73 | //@} | ||
| 74 | |||
| 75 | static IddObjectType iddObjectType(); | ||
| 76 | |||
| 77 | static std::vector<std::string> airSupplyRateCalculationModeValues(); | ||
| 78 | |||
| 79 | static std::vector<std::string> airIntakeHeatRecoveryModeValues(); | ||
| 80 | |||
| 81 | static std::vector<std::string> airSupplyConstituentModeValues(); | ||
| 82 | |||
| 83 | //extensible fields | ||
| 84 | bool addConstituent(const AirSupplyConstituent& constituent); | ||
| 85 | // Convenience function to add a constituent without explicitly creating a FuelSupplyConstituent | ||
| 86 | bool addConstituent(const std::string& name, double molarFraction); | ||
| 87 | |||
| 88 | // TODO: this should return bool (to indicate whether groupIndex is valid...) | ||
| 89 | void removeConstituent(int groupIndex); | ||
| 90 | |||
| 91 | void removeAllConstituents(); | ||
| 92 | |||
| 93 | std::vector<AirSupplyConstituent> constituents() const; | ||
| 94 | |||
| 95 | /** @name Getters */ | ||
| 96 | //@{ | ||
| 97 | |||
| 98 | boost::optional<Node> airInletNode() const; | ||
| 99 | |||
| 100 | boost::optional<CurveCubic> blowerPowerCurve() const; | ||
| 101 | |||
| 102 | double blowerHeatLossFactor() const; | ||
| 103 | |||
| 104 | std::string airSupplyRateCalculationMode() const; | ||
| 105 | |||
| 106 | boost::optional<double> stoichiometricRatio() const; | ||
| 107 | |||
| 108 | boost::optional<CurveQuadratic> airRateFunctionofElectricPowerCurve() const; | ||
| 109 | |||
| 110 | boost::optional<double> airRateAirTemperatureCoefficient() const; | ||
| 111 | |||
| 112 | boost::optional<CurveQuadratic> airRateFunctionofFuelRateCurve() const; | ||
| 113 | |||
| 114 | std::string airIntakeHeatRecoveryMode() const; | ||
| 115 | |||
| 116 | std::string airSupplyConstituentMode() const; | ||
| 117 | |||
| 118 | // TODO: this should be a non optional | ||
| 119 | boost::optional<unsigned int> numberofUserDefinedConstituents() const; | ||
| 120 | |||
| 121 | // Convenience function to check that it's equal to 1.0 (If no constituents, returns 0 and warns) | ||
| 122 | double sumofConstituentsMolarFractions() const; | ||
| 123 | |||
| 124 | // Return optional parent generator | ||
| 125 | boost::optional<GeneratorFuelCell> fuelCell() const; | ||
| 126 | |||
| 127 | //@} | ||
| 128 | /** @name Setters */ | ||
| 129 | //@{ | ||
| 130 | |||
| 131 | bool setAirInletNode(const Node& connection); | ||
| 132 | |||
| 133 | void resetAirInletNode(); | ||
| 134 | |||
| 135 | bool setBlowerPowerCurve(const CurveCubic& cubicCurves); | ||
| 136 | |||
| 137 | void resetBlowerPowerCurve(); | ||
| 138 | |||
| 139 | bool setBlowerHeatLossFactor(double blowerHeatLossFactor); | ||
| 140 | |||
| 141 | void resetBlowerHeatLossFactor(); | ||
| 142 | |||
| 143 | bool setAirSupplyRateCalculationMode(const std::string& airSupplyRateCalculationMode); | ||
| 144 | |||
| 145 | bool setStoichiometricRatio(double stoichiometricRatio); | ||
| 146 | |||
| 147 | void resetStoichiometricRatio(); | ||
| 148 | |||
| 149 | bool setAirRateFunctionofElectricPowerCurve(const CurveQuadratic& quadraticCurves); | ||
| 150 | |||
| 151 | void resetAirRateFunctionofElectricPowerCurve(); | ||
| 152 | |||
| 153 | bool setAirRateAirTemperatureCoefficient(double airRateAirTemperatureCoefficient); | ||
| 154 | |||
| 155 | void resetAirRateAirTemperatureCoefficient(); | ||
| 156 | |||
| 157 | bool setAirRateFunctionofFuelRateCurve(const CurveQuadratic& quadraticCurves); | ||
| 158 | |||
| 159 | void resetAirRateFunctionofFuelRateCurve(); | ||
| 160 | |||
| 161 | bool setAirIntakeHeatRecoveryMode(const std::string& airIntakeHeatRecoveryMode); | ||
| 162 | |||
| 163 | bool setAirSupplyConstituentMode(const std::string& airSupplyConstituentMode); | ||
| 164 | |||
| 165 | //@} | ||
| 166 | /** @name Other */ | ||
| 167 | //@{ | ||
| 168 | |||
| 169 | //@} | ||
| 170 | protected: | ||
| 171 | /// @cond | ||
| 172 | using ImplType = detail::GeneratorFuelCellAirSupply_Impl; | ||
| 173 | |||
| 174 | explicit GeneratorFuelCellAirSupply(std::shared_ptr<detail::GeneratorFuelCellAirSupply_Impl> impl); | ||
| 175 | |||
| 176 | friend class detail::GeneratorFuelCellAirSupply_Impl; | ||
| 177 | friend class Model; | ||
| 178 | friend class IdfObject; | ||
| 179 | friend class openstudio::detail::IdfObject_Impl; | ||
| 180 | /// @endcond | ||
| 181 | private: | ||
| 182 | − | REGISTER_LOGGER("openstudio.model.GeneratorFuelCellAirSupply"); | |
| 183 | }; | ||
| 184 | |||
| 185 | /** \relates GeneratorFuelCellAirSupply*/ | ||
| 186 | using OptionalGeneratorFuelCellAirSupply = boost::optional<GeneratorFuelCellAirSupply>; | ||
| 187 | |||
| 188 | /** \relates GeneratorFuelCellAirSupply*/ | ||
| 189 | using GeneratorFuelCellAirSupplyVector = std::vector<GeneratorFuelCellAirSupply>; | ||
| 190 | |||
| 191 | } // namespace model | ||
| 192 | } // namespace openstudio | ||
| 193 | |||
| 194 | #endif // MODEL_GENERATORFUELCELLAIRSUPPLY_HPP | ||
| 195 |