GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 4 / 0 / 5
Functions: 80.0% 4 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/StandardOpaqueMaterial.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_STANDARDOPAQUEMATERIAL_HPP
7 #define MODEL_STANDARDOPAQUEMATERIAL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "OpaqueMaterial.hpp"
11
12 #include "MaterialPropertyMoisturePenetrationDepthSettings.hpp"
13 #include "MaterialPropertyMoisturePenetrationDepthSettings_Impl.hpp"
14 #include "MaterialPropertyPhaseChange.hpp"
15 #include "MaterialPropertyPhaseChange_Impl.hpp"
16 #include "MaterialPropertyPhaseChangeHysteresis.hpp"
17 #include "MaterialPropertyPhaseChangeHysteresis_Impl.hpp"
18
19 namespace openstudio {
20
21 namespace model {
22
23 class MaterialPropertyMoisturePenetrationDepthSettings;
24 class MaterialPropertyPhaseChange;
25 class MaterialPropertyPhaseChangeHysteresis;
26
27 namespace detail {
28
29 class StandardOpaqueMaterial_Impl;
30
31 } // namespace detail
32
33 /** StandardOpaqueMaterial is a OpaqueMaterial that wraps the OpenStudio IDD object 'OS:OpaqueMaterial'. */
34 class MODEL_API StandardOpaqueMaterial : public OpaqueMaterial
35 {
36 public:
37 /** @name Constructors and Destructors */
38 //@{
39
40 explicit StandardOpaqueMaterial(const Model& model, const std::string& roughness = "Smooth", double thickness = 0.1, double conductivity = 0.1,
41 double density = 0.1, double specificHeat = 1400);
42
43 3412 virtual ~StandardOpaqueMaterial() override = default;
44 // Default the copy and move operators because the virtual dtor is explicit
45 14 StandardOpaqueMaterial(const StandardOpaqueMaterial& other) = default;
46 212 StandardOpaqueMaterial(StandardOpaqueMaterial&& other) = default;
47 1 StandardOpaqueMaterial& operator=(const StandardOpaqueMaterial&) = default;
48 ✗ StandardOpaqueMaterial& operator=(StandardOpaqueMaterial&&) = default;
49
50 //@}
51
52 static IddObjectType iddObjectType();
53
54 static std::vector<std::string> roughnessValues();
55
56 /** @name Getters */
57 //@{
58
59 /** The conductivity of the material in W/m*K. */
60 double thermalConductivity() const;
61
62 /** The conductance of the material in W/m^2*K. */
63 double thermalConductance() const;
64
65 /** The resistivity of the material in m*K/W. */
66 double thermalResistivity() const;
67
68 /** The resistance of the material in m^2*K/W. */
69 double thermalResistance() const;
70
71 // Thermal reflectance of the OpaqueMaterial (dimensionless fraction).
72 boost::optional<double> thermalReflectance() const;
73
74 // Solar reflectance of the OpaqueMaterial (dimensionless fraction).
75 boost::optional<double> solarReflectance() const;
76
77 // Visible reflectance of the OpaqueMaterial (dimensionless fraction).
78 boost::optional<double> visibleReflectance() const;
79
80 std::string roughness() const;
81
82 double thickness() const;
83
84 double conductivity() const;
85
86 double density() const;
87
88 double specificHeat() const;
89
90 double thermalAbsorptance() const;
91
92 bool isThermalAbsorptanceDefaulted() const;
93
94 double solarAbsorptance() const;
95
96 bool isSolarAbsorptanceDefaulted() const;
97
98 double visibleAbsorptance() const;
99
100 bool isVisibleAbsorptanceDefaulted() const;
101
102 double thermalAbsorptanceInsideFace() const;
103
104 bool isThermalAbsorptanceInsideFaceDefaulted() const;
105
106 double solarAbsorptanceInsideFace() const;
107
108 bool isSolarAbsorptanceInsideFaceDefaulted() const;
109
110 double visibleAbsorptanceInsideFace() const;
111
112 bool isVisibleAbsorptanceInsideFaceDefaulted() const;
113
114 //@}
115 /** @name Setters */
116 //@{
117
118 /** Sets the conductivity of the material in W/m*K, if possible. */
119 bool setThermalConductivity(double value);
120
121 /** Sets the conductance of the material in W/m^2*K, if possible. Sets thickness to achieve conductivity. */
122 bool setThermalConductance(double value);
123
124 /** Sets the resistivity of the material in m*K/W, if possible. */
125 bool setThermalResistivity(double value);
126
127 /** Sets the resistance of the material in m^2*K/W, if possible. Sets thickness to achieve resistivity. */
128 bool setThermalResistance(double value);
129
130 // Set the thermal absorptance (dimensionless fraction).
131 bool setThermalAbsorptance(boost::optional<double> value);
132
133 // Set the thermal reflectance (dimensionless fraction).
134 bool setThermalReflectance(boost::optional<double> value);
135
136 // Set the solar absorptance (dimensionless fraction).
137 bool setSolarAbsorptance(boost::optional<double> value);
138
139 // Set the solar reflectance (dimensionless fraction).
140 bool setSolarReflectance(boost::optional<double> value);
141
142 // Set the visible absorptance (dimensionless fraction).
143 bool setVisibleAbsorptance(boost::optional<double> value);
144
145 // Set the visible reflectance (dimensionless fraction).
146 bool setVisibleReflectance(boost::optional<double> value);
147
148 bool setRoughness(const std::string& roughness);
149
150 bool setThickness(double thickness);
151
152 bool setConductivity(double conductivity);
153
154 bool setDensity(double density);
155
156 bool setSpecificHeat(double specificHeat);
157
158 bool setThermalAbsorptance(double thermalAbsorptance);
159
160 void resetThermalAbsorptance();
161
162 bool setSolarAbsorptance(double solarAbsorptance);
163
164 void resetSolarAbsorptance();
165
166 bool setVisibleAbsorptance(double visibleAbsorptance);
167
168 void resetVisibleAbsorptance();
169
170 bool setThermalAbsorptanceInsideFace(double thermalAbsorptanceInsideFace);
171
172 void resetThermalAbsorptanceInsideFace();
173
174 bool setSolarAbsorptanceInsideFace(double solarAbsorptanceInsideFace);
175
176 void resetSolarAbsorptanceInsideFace();
177
178 bool setVisibleAbsorptanceInsideFace(double visibleAbsorptanceInsideFace);
179
180 void resetVisibleAbsorptanceInsideFace();
181
182 // if material property moisture penetration depth settings already exists, do nothing and return nil; creates the material property moisture penetration depth settings if it does not already exist and return it
183 boost::optional<MaterialPropertyMoisturePenetrationDepthSettings>
184 createMaterialPropertyMoisturePenetrationDepthSettings(double waterVaporDiffusionResistanceFactor, double moistureEquationCoefficientA,
185 double moistureEquationCoefficientB, double moistureEquationCoefficientC,
186 double moistureEquationCoefficientD, double coatingLayerThickness,
187 double coatingLayerWaterVaporDiffusionResistanceFactor);
188
189 // returns the material property moisture penetration depth settings if set
190 boost::optional<MaterialPropertyMoisturePenetrationDepthSettings> materialPropertyMoisturePenetrationDepthSettings() const;
191
192 // resets the material property moisture penetration depth settings
193 void resetMaterialPropertyMoisturePenetrationDepthSettings();
194
195 // if material property phase change already exists, do nothing and return nil; creates the material property phase change if it does not already exist and return it
196 boost::optional<MaterialPropertyPhaseChange> createMaterialPropertyPhaseChange();
197 boost::optional<MaterialPropertyPhaseChange> createMaterialPropertyPhaseChange(const std::vector<TemperatureEnthalpy>& temperatureEnthalpys);
198
199 // returns the material property phase change if set
200 boost::optional<MaterialPropertyPhaseChange> materialPropertyPhaseChange() const;
201
202 // resets the material property phase change
203 void resetMaterialPropertyPhaseChange();
204
205 // if material property phase change hysteresis already exists, do nothing and return nil; creates the material property phase change hysteresis if it does not already exist and return it
206 boost::optional<MaterialPropertyPhaseChangeHysteresis> createMaterialPropertyPhaseChangeHysteresis();
207
208 // returns the material property phase change hysteresis if set
209 boost::optional<MaterialPropertyPhaseChangeHysteresis> materialPropertyPhaseChangeHysteresis() const;
210
211 // resets the material property phase change hysteresis
212 void resetMaterialPropertyPhaseChangeHysteresis();
213
214 //@}
215 /** @name Queries */
216 //@{
217
218 /** Energy it takes to raise the temperature of this material 1 K (J/m^2*K). Equal to
219 * specificHeat() * density() * thickness(). */
220 boost::optional<double> heatCapacity() const;
221
222 //@}
223 /** @name Other */
224 //@{
225
226 //@}
227 protected:
228 /// @cond
229 using ImplType = detail::StandardOpaqueMaterial_Impl;
230
231 explicit StandardOpaqueMaterial(std::shared_ptr<detail::StandardOpaqueMaterial_Impl> impl);
232
233 friend class detail::StandardOpaqueMaterial_Impl;
234 friend class Model;
235 friend class IdfObject;
236 friend class openstudio::detail::IdfObject_Impl;
237 /// @endcond
238 private:
239 REGISTER_LOGGER("openstudio.model.StandardOpaqueMaterial");
240 };
241
242 /** \relates StandardOpaqueMaterial*/
243 using OptionalStandardOpaqueMaterial = boost::optional<StandardOpaqueMaterial>;
244
245 /** \relates StandardOpaqueMaterial*/
246 using StadardOpaqueMaterialVector = std::vector<StandardOpaqueMaterial>;
247
248 } // namespace model
249 } // namespace openstudio
250
251 #endif // MODEL_STANDARDOPAQUEMATERIAL_HPP
252