Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

Construction with internal source and .getConstructions

asked 2021-07-07 09:07:11 -0600

wei_zhang's avatar

updated 2021-07-07 10:11:03 -0600

Hi Everyone I am writing a measure to modify thermal behavior of TABS slab. I tried with two opions: 1) using "model.getConstructions" to locate the construction 2) using firstly "surface.surfaceType == 'Floor'", and then "surface.construction.get"

But both method did not find the "Construction with internal source", it seems this class is not in the scope of .getConstructions or .construction. Is there some way I could locate the ConstructionWithInternalSource?

Thanks

Wei

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-07-07 11:52:08 -0600

ConstructionWithInternalSource is a different object class than Construction. Both are child classes of LayeredConstruction, which is a child class of ConstructionBase. You can just call model.getConstructionWithInternalSources directly to get internal source constructions.

edit flag offensive delete link more

Comments

Hi Matthew

Thanks for your advice. I just tried with model.getConstructionWithInternalSources, but got one error for "dynamic constant assignment" as below.

Standard Output:
[13:43:55.018342 ERROR] :/ruby/2.5.0/gems/openstudio-workflow-2.1.0/lib/openstudio/workflow/util/measure.rb failed with message C:/Users/CGBC012/OpenStudio/Measures/test_map/measure.rb:46: dynamic constant assignment 
ConstructionInterS = model.getConstructionWithInt... 
^
wei_zhang's avatar wei_zhang  ( 2021-07-07 12:46:58 -0600 )edit

In Ruby, a variable name that starts with a capital letter (like "ConstructionInterS") is considered to be a constant, and can only be set once.

ericringold's avatar ericringold  ( 2021-07-07 13:40:56 -0600 )edit

Thanks Eric, I changed the name and it worked well

wei_zhang's avatar wei_zhang  ( 2021-07-07 15:24:48 -0600 )edit

Curious how you are modifying the thermal properties (thermal mass). I am currently working on a modeling project to estimate the total thermal mass [J/K] of a building. Tried looping through all surfaces, getting their constructions, and then looking at the combination of density [kg/m^3], specific heat [J/kg-K], thickness [m], and net surface area [m^2] to calculate a [J/K] value, but my code just printed out 0 [J/K] for all constructions...

sashadf1's avatar sashadf1  ( 2021-07-07 16:52:07 -0600 )edit

Hi sashadf1, You raised a very good question. For this moment I used .to_OpaqueMaterial.get.thermalResistance and to_OpaqueMaterial.get.setThermalResistance to change the thermal resistance of each material layer in construction. There also a pair of .to_StandardOpaqueMaterial.get.density and to_StandardOpaqueMaterial.get.setDensity to change the density.

When I tested the two pairs I found that the "setThermalResistance" in fact changed the thickness of material, and "setDensity" changed the density. I am not sure if the former will impact also thermal capacitance ?

wei_zhang's avatar wei_zhang  ( 2021-07-07 21:12:39 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2021-07-07 09:07:11 -0600

Seen: 262 times

Last updated: Feb 19 '22