NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
505 stars 192 forks source link

AirGap material returns absorptance properties even though they aren't defined #4351

Open tanushree04 opened 3 years ago

tanushree04 commented 3 years ago

Issue overview

AirGap returns absorptance properties even though they aren't defined for the material (https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-3.2.0-doc/model/html/classopenstudio_1_1model_1_1_air_gap.html). For example, material.thermalAbsorptance returns 0.0.

Current Behavior

material.thermalAbsorptance, material.solarAbsorptance, material.visibleAbsorptance return 0.0

Expected Behavior

This should raise an undefined method error.

Steps to Reproduce

Using OS CLI:

model = OpenStudio::Model::Model.new material = OpenStudio::Model::AirGap.new(model) material.thermalAbsorptance

returns 0.0

Environment

jmarrec commented 3 years ago

See related discussion in https://github.com/NREL/OpenStudio/issues/320#issuecomment-467830321

https://github.com/NREL/OpenStudio/blob/70a5549c439eda69d6c514a7275254f71f7e3d2b/src/model/AirGap.hpp#L46-L47

https://github.com/NREL/OpenStudio/blob/70a5549c439eda69d6c514a7275254f71f7e3d2b/src/model/OpaqueMaterial_Impl.hpp#L74

I guess the easiest would be to LOG_AND_THROW in https://github.com/NREL/OpenStudio/blob/develop/src/model/AirGap.cpp#L83-L86 (and there are probably tons more method like this to change...)

tijcolem commented 3 years ago

@jmarrec Can we estimate how many more methods this happens? Can we fix this particular one for now.