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

# 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?

edit retag close merge delete

Sort by » oldest newest most voted

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.

more

@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.

( 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...

( 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!

( 2017-03-04 12:30:27 -0500 )edit

Edited to something hideous that might work...

( 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

( 2017-03-04 12:35:01 -0500 )edit

Ok, I may have come to a solution:

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

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':
elif jeplus_floor == 'Top_Floor':
else:


more