Clean working directory of an EnergyPlus simulation by deleting all input and output files of previous simulation.

clean_wd(path)

Arguments

path

An .idf or .imf file path.

Details

clean_wd() imitates the same process that EnergyPlus does whenever a new simulation is getting to start. It deletes all related output files that have the same name prefix as the input path. The input model itself and any weather file are not deleted. clean_wd() is called internally when running EnergyPlus models using run_idf() and run_multi().

Examples

# \dontrun{ # run a test simulation idf_path <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") epw_path <- file.path(eplus_config(8.8)$dir, "WeatherData", "USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw" ) dir <- file.path(tempdir(), "test") run_idf(idf_path, epw_path, output_dir = dir, echo = FALSE)
#> $idf #> [1] "/tmp/Rtmp4QhbcD/temp_libpath3f9c63a4601c/eplusr/extdata/1ZoneUncontrolled.idf" #> #> $epw #> [1] "/home/travis/.local/EnergyPlus-8-8-0/WeatherData/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw" #> #> $exit_status #> [1] 0 #> #> $start_time #> [1] "2020-02-20 12:22:53 UTC" #> #> $end_time #> [1] "2020-02-20 12:22:56 UTC" #> #> $output_dir #> [1] "/tmp/Rtmpa0qSDH/test" #> #> $energyplus #> [1] "/home/travis/.local/EnergyPlus-8-8-0/energyplus-8.8.0" #> #> $stdout #> [1] "ExpandObjects Started." #> [2] "No expanded file generated." #> [3] "ExpandObjects Finished. Time: 0.002" #> [4] "EnergyPlus Starting" #> [5] "EnergyPlus, Version 8.8.0-7c3bbe4830, YMD=2020.02.20 12:22" #> [6] "Processing Data Dictionary" #> [7] "Processing Input File" #> [8] "Initializing Simulation" #> [9] "Reporting Surfaces" #> [10] "Beginning Primary Simulation" #> [11] "Initializing New Environment Parameters" #> [12] "Warming up {1}" #> [13] "Warming up {2}" #> [14] "Warming up {3}" #> [15] "Warming up {4}" #> [16] "Warming up {5}" #> [17] "Warming up {6}" #> [18] "Warming up {7}" #> [19] "Warming up {8}" #> [20] "Warming up {9}" #> [21] "Warming up {10}" #> [22] "Warming up {11}" #> [23] "Warming up {12}" #> [24] "Warming up {13}" #> [25] "Warming up {14}" #> [26] "Warming up {15}" #> [27] "Warming up {16}" #> [28] "Warming up {17}" #> [29] "Warming up {18}" #> [30] "Warming up {19}" #> [31] "Warming up {20}" #> [32] "Warming up {21}" #> [33] "Warming up {22}" #> [34] "Starting Simulation at 12/21 for DENVER CENTENNIAL GOLDEN N ANN HTG 99% CONDNS DB" #> [35] "Initializing New Environment Parameters" #> [36] "Warming up {1}" #> [37] "Warming up {2}" #> [38] "Warming up {3}" #> [39] "Warming up {4}" #> [40] "Warming up {5}" #> [41] "Warming up {6}" #> [42] "Warming up {7}" #> [43] "Warming up {8}" #> [44] "Warming up {9}" #> [45] "Warming up {10}" #> [46] "Warming up {11}" #> [47] "Warming up {12}" #> [48] "Warming up {13}" #> [49] "Warming up {14}" #> [50] "Warming up {15}" #> [51] "Warming up {16}" #> [52] "Starting Simulation at 07/21 for DENVER CENTENNIAL GOLDEN N ANN CLG 1% CONDNS DB=>MWB" #> [53] "Initializing New Environment Parameters" #> [54] "Warming up {1}" #> [55] "Warming up {2}" #> [56] "Warming up {3}" #> [57] "Warming up {4}" #> [58] "Warming up {5}" #> [59] "Warming up {6}" #> [60] "Warming up {7}" #> [61] "Warming up {8}" #> [62] "Warming up {9}" #> [63] "Warming up {10}" #> [64] "Warming up {11}" #> [65] "Warming up {12}" #> [66] "Warming up {13}" #> [67] "Warming up {14}" #> [68] "Warming up {15}" #> [69] "Warming up {16}" #> [70] "Warming up {17}" #> [71] "Warming up {18}" #> [72] "Starting Simulation at 01/01 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [73] "Updating Shadowing Calculations, Start Date=01/21" #> [74] "Continuing Simulation at 01/21 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [75] "Updating Shadowing Calculations, Start Date=02/10" #> [76] "Continuing Simulation at 02/10 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [77] "Updating Shadowing Calculations, Start Date=03/02" #> [78] "Continuing Simulation at 03/02 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [79] "Updating Shadowing Calculations, Start Date=03/22" #> [80] "Continuing Simulation at 03/22 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [81] "Updating Shadowing Calculations, Start Date=04/11" #> [82] "Continuing Simulation at 04/11 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [83] "Updating Shadowing Calculations, Start Date=05/01" #> [84] "Continuing Simulation at 05/01 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [85] "Updating Shadowing Calculations, Start Date=05/21" #> [86] "Continuing Simulation at 05/21 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [87] "Updating Shadowing Calculations, Start Date=06/10" #> [88] "Continuing Simulation at 06/10 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [89] "Updating Shadowing Calculations, Start Date=06/30" #> [90] "Continuing Simulation at 06/30 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [91] "Updating Shadowing Calculations, Start Date=07/20" #> [92] "Continuing Simulation at 07/20 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [93] "Updating Shadowing Calculations, Start Date=08/09" #> [94] "Continuing Simulation at 08/09 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [95] "Updating Shadowing Calculations, Start Date=08/29" #> [96] "Continuing Simulation at 08/29 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [97] "Updating Shadowing Calculations, Start Date=09/18" #> [98] "Continuing Simulation at 09/18 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [99] "Updating Shadowing Calculations, Start Date=10/08" #> [100] "Continuing Simulation at 10/08 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [101] "Updating Shadowing Calculations, Start Date=10/28" #> [102] "Continuing Simulation at 10/28 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [103] "Updating Shadowing Calculations, Start Date=11/17" #> [104] "Continuing Simulation at 11/17 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [105] "Updating Shadowing Calculations, Start Date=12/07" #> [106] "Continuing Simulation at 12/07 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [107] "Updating Shadowing Calculations, Start Date=12/27" #> [108] "Continuing Simulation at 12/27 for San Francisco Intl Ap CA USA TMY3 WMO#=724940" #> [109] "Writing tabular output file results using comma format." #> [110] "Writing tabular output file results using tab format." #> [111] "Writing tabular output file results using text format." #> [112] "Writing tabular output file results using HTML format." #> [113] "Writing tabular output file results using XML format." #> [114] "Writing final SQL reports" #> [115] " ReadVarsESO program starting." #> [116] " ReadVars Run Time=00hr 00min 0.23sec" #> [117] " ReadVarsESO program completed successfully." #> [118] " ReadVarsESO program starting." #> [119] " ReadVars Run Time=00hr 00min 0.11sec" #> [120] " ReadVarsESO program completed successfully." #> [121] "EnergyPlus Run Time=00hr 00min 1.77sec" #> #> $stderr #> NULL #> #> $process #> PROCESS 'energyplus-8.8.0', finished. #>
#> [1] "1ZoneUncontrolled.audit" #> [2] "1ZoneUncontrolled.bnd" #> [3] "1ZoneUncontrolled.csv" #> [4] "1ZoneUncontrolled.dxf" #> [5] "1ZoneUncontrolled.eio" #> [6] "1ZoneUncontrolled.end" #> [7] "1ZoneUncontrolled.err" #> [8] "1ZoneUncontrolled.eso" #> [9] "1ZoneUncontrolled.idf" #> [10] "1ZoneUncontrolled.mdd" #> [11] "1ZoneUncontrolled.mtd" #> [12] "1ZoneUncontrolled.mtr" #> [13] "1ZoneUncontrolled.rdd" #> [14] "1ZoneUncontrolled.rvaudit" #> [15] "1ZoneUncontrolled.shd" #> [16] "1ZoneUncontrolledMeter.csv" #> [17] "1ZoneUncontrolledSqlite.err" #> [18] "1ZoneUncontrolledTable.csv" #> [19] "1ZoneUncontrolledTable.htm" #> [20] "1ZoneUncontrolledTable.tab" #> [21] "1ZoneUncontrolledTable.txt" #> [22] "1ZoneUncontrolledTable.xml" #> [23] "USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw"
# remove all output files clean_wd(file.path(dir, basename(idf_path))) list.files(dir)
#> [1] "1ZoneUncontrolled.idf" #> [2] "USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw"
# }