First time here? Check our help page!
1

BCVTB: How to run something before the SDF director starts?

I'm thinking of parsing some stuff out of my EnergyPlus file in order to have a more flexible workflow (using Eppy), that includes filling out the typical timeStep and endTime variables that are used in all of the E+ examples that ship with the Building Control Virtual Test Bed.

How can I effectively run my script before the proper simulation integrated with E+ actually starts?

Julien Marrec's avatar
29.7k
Julien Marrec
asked 2016-07-05 08:15:59 -0500, updated 2016-07-05 08:16:17 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

I am not sure I understand your question fully but here is a "potential" answer: You could prepare your BCVTB system model (xml), manipulate your EnergyPlus input file in Python for instance, write your new idfs file and then from Python invoke the BCVTB to run your system model whenever you will want it to do so. See http://simulationresearch.lbl.gov/bcv... which describes how to invoke the BCVTB from the command line.

Hope this answers your question.

Thierry Nouidui's avatar
1.5k
Thierry Nouidui
answered 2016-07-05 10:23:08 -0500
Julien Marrec's avatar
29.7k
Julien Marrec
updated 2016-07-05 12:22:12 -0500
edit flag offensive 0 remove flag delete link

Comments

Sorry if the question isn't clear. I want to trigger IDF parsing (which I've written already) just once to pull out variables, before the actual E+ simulation starts.

I can parse out the Timestep object and the RunPeriod object to calculate the timestep and endTime used by the SDF. I'm wondering how I can trigger this before. That way if I suddenly use a timestep of 6 per hour in the IDF, I don't have to manually edit the timeStep variable to be = 10*60.

(this is an example, I do want to do more to pull variables from the IDF that I then use in my control algorithm within ptolemy).

Julien Marrec's avatar Julien Marrec (2016-07-05 10:39:21 -0500) edit

Do you want to do all that within the BCVTB or do you want to do the parsing from a script which once done will invoke the BCVTB?

Thierry Nouidui's avatar Thierry Nouidui (2016-07-05 11:24:56 -0500) edit

I was planning on staying inside the BCVTB.

I think I need to look into sockets and/or FMUImport or something, right now all of what I'm doing in the BCVTB is hacky at best (using Jython to check if update needed, and calling my system Python if so to generate an array for the next day, reuse the same array if not, etc). Wish I had more time to explore :)

Julien Marrec's avatar Julien Marrec (2016-07-05 11:32:30 -0500) edit

If you want to manipulate the BCVTB input file, then my guess will be to do all your parsing from an external script. Once that script is done and the output is written, call the BCVTB with the appropriates start, end time and time step.

Thierry Nouidui's avatar Thierry Nouidui (2016-07-05 11:46:11 -0500) edit
add a comment see more comments