1

How can i apply an EMS program to multiple windows in a building using eppy? [closed]

I am writing an energy plus ems program and i need to use eppy to use that ems on all the windows simultaneously

Padfoot's avatar
11
Padfoot
asked 2020-08-02 13:05:25 -0500
edit flag offensive 0 remove flag reopen merge delete

Closed for the following reason "duplicate question" by Padfoot 2020-08-10 02:59:53 -0500

Comments

add a comment see more comments

1 Answer

3

Using Eppy, you can list all the fenestration names for Input Data File (IDF) parsed to the python script. Add the EMS program as string in python script. Append the EMS program into IDF by adding new fenestration name into while iterating the fenestration names using "for" loop. The following sample code explains in detail-

  1. from eppy import modeleditor
  2. from eppy.modeleditor import IDF
  3. iddFn = [Assign ur IDD file name with path]
  4. idfFn = [Assign ur IDF file name with path]
  5. idf = IDF(idfFn)
  6. fenNamesList = [x.Name for x in idf.idfobjects[''FENESTRATIONSURFACE:DETAILED"]
  7. emsProgramLine2 = "[Mathematical operation],"
  8. emsProgramLine3 = "[if clause],"
  9. emsProgramLastLine = "[last line of program];"
  10. programNames = []
  11. i = 0
  12. for fenName in fenNamesList:
  13. i += 1
  14. idf1.newidfobject(''FENESTRATIONSURFACE:DETAILED")
  15. program = idf.idfobjects[''ENERGYMANAGEMENTSYSTEM:PROGRAM"][-1]
  16. program.Name = 'p'+str(i)
  17. program.Program_Line_1 = [ according my code i want to assign fenName in line1 of ems program)
  18. program.Program_Line_2 = emsProgramLine2
  19. program.Program_A4 = emsProgramLine3 [and this continues based on the ems logic to be scripted
  20. idf.saveas('emsProgramAppended.idf')

In May of 2020, Python Plugin was added to EP version 9.3 by NREL, where you can script the logic in Python directly and assign the file as function for EP runtime simulation. This avoids the use of Erl and you can use or call complex mathematical models in python. Please go through the documentation to learn python plugin if you are interested (https://nrel.github.io/EnergyPlus/api...).

nvskumar.m's avatar
31
nvskumar.m
answered 2020-08-03 02:24:26 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments