src/model/OtherEquipmentDefinition.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_OTHEREQUIPMENTDEFINITION_HPP | ||
| 7 | #define MODEL_OTHEREQUIPMENTDEFINITION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "SpaceLoadDefinition.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class OtherEquipmentDefinition_Impl; | ||
| 18 | |||
| 19 | } // namespace detail | ||
| 20 | |||
| 21 | /** OtherEquipmentDefinition is a SpaceLoadDefinition that wraps the OpenStudio IDD object | ||
| 22 | * 'OS:OtherEquipment:Definition'. Its fields are derived from the EnergyPlus IDD object | ||
| 23 | * 'OtherEquipment'. Note that this object represents an arbitrary internal gain (or loss) | ||
| 24 | * not tied into any end-use category, and so should be used with caution. | ||
| 25 | * \sa OtherEquipment | ||
| 26 | */ | ||
| 27 | class MODEL_API OtherEquipmentDefinition : public SpaceLoadDefinition | ||
| 28 | { | ||
| 29 | |||
| 30 | public: | ||
| 31 | /** @name Constructors and Destructors */ | ||
| 32 | //@{ | ||
| 33 | |||
| 34 | explicit OtherEquipmentDefinition(const Model& model); | ||
| 35 | |||
| 36 | 17 | virtual ~OtherEquipmentDefinition() override = default; | |
| 37 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 38 | ✗ | OtherEquipmentDefinition(const OtherEquipmentDefinition& other) = default; | |
| 39 | 1 | OtherEquipmentDefinition(OtherEquipmentDefinition&& other) = default; | |
| 40 | ✗ | OtherEquipmentDefinition& operator=(const OtherEquipmentDefinition&) = default; | |
| 41 | ✗ | OtherEquipmentDefinition& operator=(OtherEquipmentDefinition&&) = default; | |
| 42 | |||
| 43 | //@} | ||
| 44 | |||
| 45 | static IddObjectType iddObjectType(); | ||
| 46 | |||
| 47 | static std::vector<std::string> validDesignLevelCalculationMethodValues(); | ||
| 48 | |||
| 49 | /** @name Getters */ | ||
| 50 | //@{ | ||
| 51 | |||
| 52 | std::string designLevelCalculationMethod() const; | ||
| 53 | boost::optional<double> designLevel() const; | ||
| 54 | boost::optional<double> wattsperSpaceFloorArea() const; | ||
| 55 | boost::optional<double> wattsperPerson() const; | ||
| 56 | |||
| 57 | double fractionLatent() const; | ||
| 58 | bool isFractionLatentDefaulted() const; | ||
| 59 | |||
| 60 | double fractionRadiant() const; | ||
| 61 | bool isFractionRadiantDefaulted() const; | ||
| 62 | |||
| 63 | double fractionLost() const; | ||
| 64 | bool isFractionLostDefaulted() const; | ||
| 65 | |||
| 66 | //@} | ||
| 67 | /** @name Setters */ | ||
| 68 | //@{ | ||
| 69 | |||
| 70 | /// Sets designLevelCalculationMethod to 'EquipmentLevel', clears wattsperSpaceFloorArea | ||
| 71 | /// and wattsperPerson, and sets designLevel. | ||
| 72 | bool setDesignLevel(double designLevel); | ||
| 73 | |||
| 74 | /// Sets designLevelCalculationMethod to 'Watts/Area', clears designLevel | ||
| 75 | /// and wattsperPerson, and sets wattsperSpaceFloorArea. | ||
| 76 | bool setWattsperSpaceFloorArea(double wattsperSpaceFloorArea); | ||
| 77 | |||
| 78 | /// Sets designLevelCalculationMethod to 'Watts/Person', clears designLevel | ||
| 79 | /// and wattsperSpaceFloorArea, and sets wattsperPerson. | ||
| 80 | bool setWattsperPerson(double wattsperPerson); | ||
| 81 | |||
| 82 | bool setFractionLatent(double fractionLatent); | ||
| 83 | void resetFractionLatent(); | ||
| 84 | |||
| 85 | bool setFractionRadiant(double fractionRadiant); | ||
| 86 | void resetFractionRadiant(); | ||
| 87 | |||
| 88 | bool setFractionLost(double fractionLost); | ||
| 89 | void resetFractionLost(); | ||
| 90 | |||
| 91 | //@} | ||
| 92 | /** @name Other */ | ||
| 93 | //@{ | ||
| 94 | |||
| 95 | /** Returns the design level represented by this definition, assuming floorArea (m^2) and | ||
| 96 | * numPeople. */ | ||
| 97 | double getDesignLevel(double floorArea, double numPeople) const; | ||
| 98 | |||
| 99 | /** Returns the watts/m^2 represented by this definition, assuming floorArea (m^2) and | ||
| 100 | * numPeople. */ | ||
| 101 | double getPowerPerFloorArea(double floorArea, double numPeople) const; | ||
| 102 | |||
| 103 | /** Returns the watts/person represented by this definition, assuming floorArea (m^2) and | ||
| 104 | * numPeople. */ | ||
| 105 | double getPowerPerPerson(double floorArea, double numPeople) const; | ||
| 106 | |||
| 107 | /** If method is a \link validDesignLevelCalculationMethodValues valid design level | ||
| 108 | * calculation method \endlink, changes this definition to an equivalent power level, under | ||
| 109 | * the assumptions of floorArea (m^2) and numPeople. */ | ||
| 110 | bool setDesignLevelCalculationMethod(const std::string& method, double floorArea, double numPeople); | ||
| 111 | |||
| 112 | //@} | ||
| 113 | protected: | ||
| 114 | /// @cond | ||
| 115 | using ImplType = detail::OtherEquipmentDefinition_Impl; | ||
| 116 | |||
| 117 | friend class detail::OtherEquipmentDefinition_Impl; | ||
| 118 | friend class openstudio::detail::IdfObject_Impl; | ||
| 119 | friend class IdfObject; | ||
| 120 | friend class Model; | ||
| 121 | |||
| 122 | explicit OtherEquipmentDefinition(std::shared_ptr<detail::OtherEquipmentDefinition_Impl> impl); | ||
| 123 | |||
| 124 | /// @endcond | ||
| 125 | private: | ||
| 126 | REGISTER_LOGGER("openstudio.model.OtherEquipmentDefinition"); | ||
| 127 | }; | ||
| 128 | |||
| 129 | /** \relates OtherEquipmentDefinition*/ | ||
| 130 | using OptionalOtherEquipmentDefinition = boost::optional<OtherEquipmentDefinition>; | ||
| 131 | |||
| 132 | /** \relates OtherEquipmentDefinition*/ | ||
| 133 | using OtherEquipmentDefinitionVector = std::vector<OtherEquipmentDefinition>; | ||
| 134 | |||
| 135 | } // namespace model | ||
| 136 | } // namespace openstudio | ||
| 137 | |||
| 138 | #endif // MODEL_OTHEREQUIPMENTDEFINITION_HPP | ||
| 139 |