-
Notifications
You must be signed in to change notification settings - Fork 1
Simulation
guxsousa edited this page Jul 5, 2018
·
4 revisions
First off, for this basic example, a dwelling archetype is selected.
id.model <- 1
A weather file (in Energy Plus format: EPW) is referenced.
(var.EnHub.weatherFile <- as.character(tbl.ONS.Region.ref$epw[tbl.ONS.Region.ref$Regions == as.character(tbl.EHS.buildingSet.der$.region[id.model])]))
And the generated IDF is then passed to the argument of the function fnRunEnergyPlus() to perform the simulation
(see generation of IDF).
fnRunEnergyPlus(var.idfModelToRun, id.model, var.EnHub.weatherFile, .Platform$OS.type)
If required, the output table may be directly stored in a data.frame.
tbl.Sim.outputs.der <- fnRunEnergyPlus(var.idfModelToRun, id.model, var.EnHub.weatherFile, .Platform$OS.type)
To check on the performance of the simulation process, a couple of parameters may be attached to the process: proc.time() and progress.bar. The following example shows their application.
ptm <- proc.time() opb <- pboptions(type="txt", title="UK SET simulation") fnRunEnergyPlus(var.idfModelToRun, id.model, var.EnHub.weatherFile, .Platform$OS.type) fnDisplaySimulationUsedTime(proc.time(), ptm); rm(ptm);
This method applies the function fnRunEnergyPlus() repeatedly (see the script Run_EnergyPlus.R)
ptm <- proc.time() opb <- pboptions(type="txt", title="UK SET simulation") invisible(pblapply(1:10, fnRunEnergyPlusIteratively, F)) fnDisplaySimulationUsedTime(proc.time(), ptm); rm(ptm);
See Test