Surface Temperature Extraction

The VE Python API allows users create simple programs using the Python Programming Language, to interact with a VE Model and/or Vista Results File
Post Reply
murphyrw
VE Newbie
VE Newbie
Posts: 8
Joined: Mon Jul 27, 2009 10:23 am

Surface Temperature Extraction

Post by murphyrw »

Directed here by IES support. It's my first question here, so sorry if I'm asking the obvious, be kind...

I believe this question has been asked 3 times already, dating back 7 years. If I get an answer I will close off these 3 too:

https://forums.iesve.com/viewtopic.php? ... 64e04e1776
Asks in 2018 “Any recommendations on how do I extract surface temperature … from an internal wall”

https://forums.iesve.com/viewtopic.php? ... 64e04e1776
Asks in 2022 “I am trying to extract the surface simulation data using VE Python API, I went through all of the surfaces and a lot of data was missing, “

https://forums.iesve.com/viewtopic.php? ... 64e04e1776
Asks in 2020 “I have noticed however it doesn't work on internal partitions, nor fully glazed surfaces. Why? How Can I fix it?”

Now my original question to support:
I'm trying to extract surface temperatures for each surface in the model, and for each hour of the year.


My attempt is with the code below. For each room, it finds each surface and gets out temperatures. But it only gives out temperatures for external rooms. My guess: you need to drill down into adjacency level for internal rooms with multiple adjacency. I just (and the 3 other people before me) don't know how to drill down to this level. Code attempt below:



import iesve
from ies_file_picker import IesFilePicker

project = iesve.VEProject.get_current_project()
real_building = project.models[0]
file_name = IesFilePicker.pick_aps_file()
aps_file = iesve.ResultsReader.open(file_name)
c=0

bodies = real_building.get_bodies(False)
for body in bodies:
print("BODY",body.name)
surfaces = body.get_surfaces()
for surface in surfaces:
c=c+1
print ("SURFACE ID ",surface.index," ", surface.type)
surf_properties = surface.get_properties()
surf_dict=aps_file.get_all_surface_results(body.id, surf_properties['aps_handle'],'Int surface temperature')
print(surf_dict)

if c>40:
break



Works fine for external surfaces, but not for internal surfaces. My guess it’s something to do with adjacencies?
Can you help me have the code output temperatures for internal surfaces (or adjacencies) too?
Here's the output,

BODY 000Lift00
SURFACE ID 0 floor
None
SURFACE ID 1 ceiling
None
SURFACE ID 2 int_wall
None
SURFACE ID 3 int_wall
None
SURFACE ID 4 int_wall
None
SURFACE ID 5 int_wall
None
BODY 000x00
SURFACE ID 0 floor
None
SURFACE ID 1 ceiling
None
SURFACE ID 2 int_wall
None
SURFACE ID 3 ext_wall
{'Int surface temperature': array([4.443468 , 4.434904 , 4.4239907, ..., 3.6893606, 3.6863866,
3.6823366], dtype=float32)}
SURFACE ID 4 int_wall
None
SURFACE ID 5 int_wall
None
BODY 000x01
SURFACE ID 0 floor
None
SURFACE ID 1 ceiling
None
SURFACE ID 2 int_wall
None
SURFACE ID 3 int_wall
None
SURFACE ID 4 int_wall
None
SURFACE ID 5 int_wall
None
BODY 000x02
SURFACE ID 0 floor
None
SURFACE ID 1 ceiling
None
SURFACE ID 2 int_wall
None
SURFACE ID 3 ext_wall
{'Int surface temperature': array([4.977598 , 4.9690895, 4.958558 , ..., 4.2698812, 4.266589 ,
4.262176 ], dtype=float32)}
SURFACE ID 4 ext_wall
{'Int surface temperature': array([4.9940414, 4.984935 , 4.9737625, ..., 4.287549 , 4.2839885,
4.2791514], dtype=float32)}
SURFACE ID 5 int_wall
None
BODY 000x03
SURFACE ID 0 floor
None
SURFACE ID 1 ceiling
None
SURFACE ID 2 ext_wall
None
SURFACE ID 3 ext_wall
None
SURFACE ID 4 int_wall
None
SURFACE ID 5 int_wall
None
BODY 000x05
SURFACE ID 0 floor
None
SURFACE ID 1 ceiling
None
SURFACE ID 2 int_wall
None
SURFACE ID 3 int_wall
None
SURFACE ID 4 ext_wall
{'Int surface temperature': array([8.746157 , 8.74024 , 8.73263 , ..., 6.658963 , 6.6573944,
6.6548862], dtype=float32)}
SURFACE ID 5 int_wall
None
BODY 000x06
SURFACE ID 0 ground_floor
{'Int surface temperature': array([6.3013434, 6.1525903, 5.9676476, ..., 5.0933304, 5.065756 ,
5.0105977], dtype=float32)}
SURFACE ID 1 roof
{'Int surface temperature': array([6.2879477, 6.1224437, 5.930233 , ..., 5.079647 , 5.052657 ,
4.9985204], dtype=float32)}
SURFACE ID 2 ext_wall
{'Int surface temperature': array([6.7030573, 6.6509085, 6.578186 , ..., 5.335616 , 5.328577 ,
5.313607 ], dtype=float32)}
SURFACE ID 3 int_wall
None
SURFACE ID 4 ext_wall
{'Int surface temperature': array([6.679811 , 6.628497 , 6.5566716, ..., 5.310723 , 5.304026 ,
5.2896314], dtype=float32)}
SURFACE ID 5 ext_wall
{'Int surface temperature': array([6.7254567, 6.6723433, 6.598647 , ..., 5.360592 , 5.3527813,
5.336939 ], dtype=float32)}
murphyrw
VE Newbie
VE Newbie
Posts: 8
Joined: Mon Jul 27, 2009 10:23 am

Re: Surface Temperature Extraction

Post by murphyrw »

Update:

surf_properties = surface.get_properties()
aps=surf_properties['aps_handle']

For EXTERNAL surfaces: gives the correct number to feed into
get_all_surface_results(body.id, aps,'Int surface temperature')

For INTERNAL surfaces, gives the correct number + two to the power of 16 ....
My guess - erroneous conversion between 16 bit and 32 bit?

So adding %(2**16) rounds off that initial bit, and you can get answers out for internal surfaces...

Final problem - internal surfaces report temperatures at adjacency level, not surface level (you will see multiple results for surfaces that back onto multiple rooms)... and this method only reports back the first adjacency's temperatures.

Any idea how to break a model down so that there's only one adjacency in each surface? Or any other way of fixing this?

(Will not update the 3 other people who asked this exact same problem over the last 7 years till I have it properly fixed)
murphyrw
VE Newbie
VE Newbie
Posts: 8
Joined: Mon Jul 27, 2009 10:23 am

Re: Surface Temperature Extraction

Post by murphyrw »

Third update in a row - we still aren't able to output values for any adjacency - other than the first in the surface, but this fixes it.

So go into ModelIT, select all rooms, right click on them, and click "configure rooms to neighboring rooms" - this splits surfaces by adjacency ... so you have only one adjacency per room. Annoyingly it does strip off construction information from at least the internal surfaces... so that will need to be re-applied. Anyone who reads this and has a fix for that... ideally an auto applier ... that would be greatly appreciated.

(Bonus fact ... the top end of the 32 bit number we had to split earlier in this post appears to be the number of adjacency.... external surfaces have zero, which is why the two 16 bit integers smashed together into one 32 bit still worked).
murphyrw
VE Newbie
VE Newbie
Posts: 8
Joined: Mon Jul 27, 2009 10:23 am

Re: Surface Temperature Extraction

Post by murphyrw »

I take it back, looks like configure rooms to neighboring rooms doesn't always work.
Unless it's a dummy room + one extra room. So I'm very slowly working through the model.. click one room, click dummy, configure neighboring.. and on to the next room.

This is the fourth post in a row from me, on a topic that's been open for 7 years with three other questions.
Anyone else want to jump in ... feel free...
Post Reply