2

Construction with internal source and .getConstructions

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

wei_zhang's avatar
137
wei_zhang
asked 2021-07-07 09:07:11 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2021-07-07 10:11:03 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

3

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.

mdahlhausen's avatar
9.5k
mdahlhausen
answered 2021-07-07 11:52:08 -0500
edit flag offensive 0 remove flag delete link

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 -0500) 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 -0500) edit

Thanks Eric, I changed the name and it worked well

wei_zhang's avatar wei_zhang (2021-07-07 15:24:48 -0500) 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 -0500) 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 -0500) edit
add a comment see more comments