3

Using eppy + jeplus to make selected external surfaces adiabatic

Hi, I am setting up parametric simulations for residential buildings to be done with jeplus. For a given plan form (say a single-aspect 1bedroom flat) representing one unit, I am willing to create 2 'branches' in a parameter tree, representing: - 3 scenarios with regards to the location of the 1bed flat in a building, i.e. ground, mid-floor or top-floor. - 2 scenarios with regards to the location of the 1bed flat on a floorplate (middle or end of the floorplate).

In energy-plus terms, this could be done 'manually' in Open Studio, by creating standard external constructions (SU plugin) and setting them to be adiabatic. However, this would result in a high number or IDF file to be fed into jeplus for further parametric sims.

Hence, I would to do this using eppy - amending one IDF file containing baseline external constructions to replace external surfaces to adiabatic depending on the combination of two jeplus parameters (which could be @@layout@@ and @@floor@@). The latter approach is more elegant, but also more complicated to achieve. I wrote some eppy code (https://codeshare.io/2EB8ew), which: - replaces all floors and ceilings with adiabatic surfaces loops through

  • loops through walls to sub-select those which do not host windows (party walls or walls to corridors) - and who may thus be changed to adiabatic.

Could you advise on how this eppy code could be used in conjuction jeplus?

andrea.botti's avatar
415
andrea.botti
asked 2017-03-03 10:25:55 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-04-01 15:27:09 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

3

Your Eppy code needs to run before the jEPlus code. One way to achieve what you want would be to use EPMacro code, which can be inserted by Eppy.

Extending on the code from your snippet (untested):

for wall in walls:
    if wall.Name in ext_walls_windowless:
        wall.Outside_Boundary_Condition = "## IF EVAL[#[Layout[] EQS TRUE] AND #[Floor[] EQS TRUE]]\r\nAdiabatic,\r\n## ELIF EVAL[#[Layout[] EQS FALSE] AND #[Floor[] EQS FALSE]] \r\nOutside,\r\n \r\n##ENDIF"
        wall.Sun_Exposure = "## IF EVAL[#[Layout[] EQS TRUE] AND #[Floor[] EQS TRUE]]\r\nNoSun,\r\n## ELIF EVAL[#[Layout[] EQS FALSE] AND #[Floor[] EQS FALSE]] \r\nSunExposed,\r\n \r\n##ENDIF"
        wall.Wind_Exposure = "## IF EVAL[#[Layout[] EQS TRUE] AND #[Floor[] EQS TRUE]]\r\nNoWind,\r\n## ELIF EVAL[#[Layout[] EQS FALSE] AND #[Floor[] EQS FALSE]] \r\nWindExposed,\r\n \r\n##ENDIF"

As I say, this is untested but I think it should work, at the expense of being quite unreadable. I think there's scope for some kind of extension to Eppy here to generate EPMacro code.

I wouldn't be surprised if Ivan Korolija orYi Zhang have worked out a better way of doing this though.

Jamie Bull's avatar
5.1k
Jamie Bull
answered 2017-03-03 12:01:52 -0500, updated 2017-03-04 12:31:53 -0500
edit flag offensive 0 remove flag delete link

Comments

@Jamie Bull thanks very much for your reply! I am trying to figure out how I can make your suggested snippet work, given that # would make eppy ignore the code line.

andrea.botti's avatar andrea.botti (2017-03-04 10:42:12 -0500) edit

To be honest I'm struggling to think what I did too. Perhaps the file I was looking at predates Eppy...

Jamie Bull's avatar Jamie Bull (2017-03-04 12:09:18 -0500) edit
1

eheheheheh I felt incredibly daft for about half an hour trying to figure out how to run variable attributions in python with ep-macro if statements...and within python for cycles!

andrea.botti's avatar andrea.botti (2017-03-04 12:30:27 -0500) edit

Edited to something hideous that might work...

Jamie Bull's avatar Jamie Bull (2017-03-04 12:31:20 -0500) edit

You'll also need to add the ##SET1 Layout[] @@layout@@, etc. statements to start of the output .imf file/s but that's a simple bit of Python

Jamie Bull's avatar Jamie Bull (2017-03-04 12:35:01 -0500) edit
add a comment see more comments
2

Ok, I may have come to a solution:

import os
from eppy.modeleditor import IDF
import sys
import math
from geomeppy import IDF

def make_adiabatic(c):
        print('converting %s into adiabatic' %c)
        c.Outside_Boundary_Condition = 'Adiabatic'
        c.Sun_Exposure = 'NoSun'
        c.Wind_Exposure = 'NoWind'
        print('done\n')


# path to E+ idd file (required by eppy)
iddfile = os.path.join(sys.argv[4], 'Energy+.idd')
IDF.setiddname(iddfile)

# path to energyplus input file within each simulated folder
idf = os.path.join(sys.argv[2], 'in.idf')

# assigns reads parameter from jeplus
jeplus_floor = str(sys.argv[3])

# read idf file to eppy
idf = IDF(idf)

# Convert horizontal surfaces to adiabatic depending on the value of the jeplus parameter 
floors = idf_New.getsurfaces('Floor')
ceilings = idf_New.getsurfaces('Ceiling')
roofs = idf_New.getsurfaces('Roof')

if jeplus_floor == 'Ground_Floor':
    adiab_ceilings = make_adiabatic((c) for c in ceilings)
    adiab_roofs = make_adiabatic((c) for c in roofs)
elif jeplus_floor == 'Top_Floor':
    adiab_floors = make_adiabatic((c) for c in floors)
else:
    adiab_floors = make_adiabatic((c) for c in floors)
    adiab_ceilings = make_adiabatic((c) for c in ceilings)
    adiab_roofs = make_adiabatic((c) for c in roofs)

I look forward to receive your feedback on this!

andrea.botti's avatar
415
andrea.botti
answered 2017-03-08 10:05:04 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments