src/model/AirflowNetworkDetailedOpening.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_AIRFLOWNETWORKDETAILEDOPENING_HPP | ||
| 7 | #define MODEL_AIRFLOWNETWORKDETAILEDOPENING_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | |||
| 11 | #include "AirflowNetworkComponent.hpp" | ||
| 12 | |||
| 13 | namespace openstudio { | ||
| 14 | |||
| 15 | namespace model { | ||
| 16 | |||
| 17 | class MODEL_API DetailedOpeningFactorData | ||
| 18 | { | ||
| 19 | public: | ||
| 20 | /** @name Constructor */ | ||
| 21 | //@{ | ||
| 22 | DetailedOpeningFactorData(double openingFactor, double dischargeCoefficient, double widthFactor, double heightFactor, double startHeightFactor); | ||
| 23 | |||
| 24 | //@} | ||
| 25 | /** @name Getters */ | ||
| 26 | //@{ | ||
| 27 | /** For a rectangular non-pivoted window or door (LVO Type 1), the opening factor corresponds to the fraction of the | ||
| 28 | * window or door that is opened. For rectangular horizontally-pivoted windows (LVO Type 2), the opening factor is | ||
| 29 | * the angular fraction that window is open. For example, an opening angle of 45 degrees corresponds to an opening | ||
| 30 | * factor of 0.50 since the maximum opening angle is 90 degrees. | ||
| 31 | */ | ||
| 32 | double openingFactor() const; | ||
| 33 | /** The discharge coefficient indicates the fractional effectiveness for air flow through a window or door at | ||
| 34 | * that Opening Factor. | ||
| 35 | */ | ||
| 36 | double dischargeCoefficient() const; | ||
| 37 | /** The width factor is the opening width divided by the window or door width. */ | ||
| 38 | double widthFactor() const; | ||
| 39 | /** The height factor is the opening height divided by the window or door height. */ | ||
| 40 | double heightFactor() const; | ||
| 41 | /** The start height factor is the start height divided by the window or door height. | ||
| 42 | * Start height is the distance between the bottom of the window or door and the | ||
| 43 | * bottom of the window or door opening. The sum of the height factor and the start height | ||
| 44 | * factor must be less than 1.0 in order to have the opening within the window or door dimensions. | ||
| 45 | */ | ||
| 46 | double startHeightFactor() const; | ||
| 47 | |||
| 48 | //@} | ||
| 49 | /** @name Setters */ | ||
| 50 | //@{ | ||
| 51 | /** Sets the opening factor. */ | ||
| 52 | bool setOpeningFactor(double openingFactor); | ||
| 53 | /** Sets the discharge coefficient. */ | ||
| 54 | bool setDischargeCoefficient(double dischargeCoefficient); | ||
| 55 | /** Sets the width factor. */ | ||
| 56 | bool setWidthFactor(double widthFactor); | ||
| 57 | /** Sets the height factor. */ | ||
| 58 | bool setHeightFactor(double heightFactor); | ||
| 59 | /** Sets the start height factor. */ | ||
| 60 | bool setStartHeightFactor(double startHeightFactor); | ||
| 61 | //@} | ||
| 62 | private: | ||
| 63 | double m_openingFactor; | ||
| 64 | double m_dischargeCoefficient; | ||
| 65 | double m_widthFactor; | ||
| 66 | double m_heightFactor; | ||
| 67 | double m_startHeightFactor; | ||
| 68 | }; | ||
| 69 | |||
| 70 | namespace detail { | ||
| 71 | |||
| 72 | class AirflowNetworkDetailedOpening_Impl; | ||
| 73 | |||
| 74 | } // namespace detail | ||
| 75 | |||
| 76 | /** AirflowNetworkDetailedOpening is a ModelObject that wraps the OpenStudio IDD object 'OS:AirflowNetworkDetailedOpening'. */ | ||
| 77 | class MODEL_API AirflowNetworkDetailedOpening : public AirflowNetworkComponent | ||
| 78 | { | ||
| 79 | public: | ||
| 80 | /** @name Constructors and Destructors */ | ||
| 81 | //@{ | ||
| 82 | /** Construct a detailed opening object. */ | ||
| 83 | AirflowNetworkDetailedOpening(const Model& model, double massFlowCoefficientWhenOpeningisClosed, double massFlowExponentWhenOpeningisClosed, | ||
| 84 | const std::string& typeofRectangularLargeVerticalOpening, double extraCrackLengthorHeightofPivotingAxis, | ||
| 85 | const std::vector<DetailedOpeningFactorData>& openingFactors); | ||
| 86 | /** Construct a detailed opening object with defaulted values. */ | ||
| 87 | AirflowNetworkDetailedOpening(const Model& model, double massFlowCoefficientWhenOpeningisClosed, | ||
| 88 | const std::vector<DetailedOpeningFactorData>& openingFactors); | ||
| 89 | |||
| 90 | 6 | virtual ~AirflowNetworkDetailedOpening() override = default; | |
| 91 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 92 | ✗ | AirflowNetworkDetailedOpening(const AirflowNetworkDetailedOpening& other) = default; | |
| 93 | 1 | AirflowNetworkDetailedOpening(AirflowNetworkDetailedOpening&& other) = default; | |
| 94 | ✗ | AirflowNetworkDetailedOpening& operator=(const AirflowNetworkDetailedOpening&) = default; | |
| 95 | ✗ | AirflowNetworkDetailedOpening& operator=(AirflowNetworkDetailedOpening&&) = default; | |
| 96 | |||
| 97 | //@} | ||
| 98 | |||
| 99 | static IddObjectType iddObjectType(); | ||
| 100 | |||
| 101 | static std::vector<std::string> typeofRectangularLargeVerticalOpeningValues(); | ||
| 102 | |||
| 103 | /** @name Getters */ | ||
| 104 | //@{ | ||
| 105 | /** Returns the air mass flow coefficient when the opening is closed. */ | ||
| 106 | double airMassFlowCoefficientWhenOpeningisClosed() const; | ||
| 107 | /** Returns the air mass flow exponent when the opening is closed. */ | ||
| 108 | double airMassFlowExponentWhenOpeningisClosed() const; | ||
| 109 | /** Returns true if the air mass flow exponent when the opening is closed is defaulted. */ | ||
| 110 | bool isAirMassFlowExponentWhenOpeningisClosedDefaulted() const; | ||
| 111 | /** Returns the LVO type. */ | ||
| 112 | std::string typeofRectangularLargeVerticalOpening() const; | ||
| 113 | /** Returns true if the LVO type is defaulted. */ | ||
| 114 | bool isTypeofRectangularLargeVerticalOpeningDefaulted() const; | ||
| 115 | /** Returns the extra crack length or height of pivoting axis. */ | ||
| 116 | double extraCrackLengthorHeightofPivotingAxis() const; | ||
| 117 | /** Returns true if the extra crack length or height of pivoting axis is defaulted. */ | ||
| 118 | bool isExtraCrackLengthorHeightofPivotingAxisDefaulted() const; | ||
| 119 | /** Returns the opening factor data. */ | ||
| 120 | std::vector<DetailedOpeningFactorData> openingFactors() const; | ||
| 121 | |||
| 122 | //@} | ||
| 123 | /** @name Setters */ | ||
| 124 | //@{ | ||
| 125 | /** Sets the air mass flow coefficient when the opening is closed. */ | ||
| 126 | bool setAirMassFlowCoefficientWhenOpeningisClosed(double airMassFlowCoefficientWhenOpeningisClosed); | ||
| 127 | /** Sets the air mass flow exponent when the opening is closed. */ | ||
| 128 | bool setAirMassFlowExponentWhenOpeningisClosed(double airMassFlowExponentWhenOpeningisClosed); | ||
| 129 | /** Resets the air mass flow exponent when the opening is closed. */ | ||
| 130 | void resetAirMassFlowExponentWhenOpeningisClosed(); | ||
| 131 | /** Sets the LVO type. */ | ||
| 132 | bool setTypeofRectangularLargeVerticalOpening(const std::string& typeofRectangularLargeVerticalOpening); | ||
| 133 | /** Resets the LVO type. */ | ||
| 134 | void resetTypeofRectangularLargeVerticalOpening(); | ||
| 135 | /** Sets the extra crack length or height of pivoting axis. */ | ||
| 136 | bool setExtraCrackLengthorHeightofPivotingAxis(double extraCrackLengthorHeightofPivotingAxis); | ||
| 137 | /** Resets the extra crack length or height of pivoting axis. */ | ||
| 138 | void resetExtraCrackLengthorHeightofPivotingAxis(); | ||
| 139 | /** Sets the opening factor data. */ | ||
| 140 | bool setOpeningFactors(const std::vector<DetailedOpeningFactorData>& factors); | ||
| 141 | |||
| 142 | //@} | ||
| 143 | protected: | ||
| 144 | /// @cond | ||
| 145 | using ImplType = detail::AirflowNetworkDetailedOpening_Impl; | ||
| 146 | |||
| 147 | explicit AirflowNetworkDetailedOpening(std::shared_ptr<detail::AirflowNetworkDetailedOpening_Impl> impl); | ||
| 148 | |||
| 149 | friend class detail::AirflowNetworkDetailedOpening_Impl; | ||
| 150 | friend class Model; | ||
| 151 | friend class IdfObject; | ||
| 152 | friend class openstudio::detail::IdfObject_Impl; | ||
| 153 | /// @endcond | ||
| 154 | private: | ||
| 155 | REGISTER_LOGGER("openstudio.model.AirflowNetworkDetailedOpening"); | ||
| 156 | }; | ||
| 157 | |||
| 158 | /** \relates AirflowNetworkDetailedOpening*/ | ||
| 159 | using OptionalAirflowNetworkDetailedOpening = boost::optional<AirflowNetworkDetailedOpening>; | ||
| 160 | |||
| 161 | /** \relates AirflowNetworkDetailedOpening*/ | ||
| 162 | using AirflowNetworkDetailedOpeningVector = std::vector<AirflowNetworkDetailedOpening>; | ||
| 163 | |||
| 164 | } // namespace model | ||
| 165 | } // namespace openstudio | ||
| 166 | |||
| 167 | #endif // MODEL_AIRFLOWNETWORKDETAILEDOPENING_HPP | ||
| 168 |