read_idf takes an EnergyPlus Input Data File (IDF) as input and returns an Idf object. For more details on Idf object, please see Idf class.

read_idf(path, idd = NULL)

Arguments

path

Either a path, a connection, or literal data (either a single string or a raw vector) to an EnergyPlus Input Data File (IDF). If a file path, that file usually has a extension .idf.

idd

Any acceptable input of use_idd(). If NULL, which is the default, the version of IDF will be passed to use_idd(). If the input is an .ddy file which does not have a version field, the latest version of Idf cached will be used.

Value

An Idf object.

Details

Currently, Imf file is not fully supported. All EpMacro lines will be treated as normal comments of the nearest downwards object. If input is an Imf file, a warning will be given during parsing. It is recommended to convert the Imf file to an Idf file and use ParametricJob class to conduct parametric analysis.

See also

Idf class for modifying EnergyPlus model. use_idd() and download_idd() for downloading and parsing EnergyPlus IDD file. use_eplus() for configuring which version of EnergyPlus to use.

Examples

# \dontrun{ # example model shipped with eplusr from EnergyPlus v8.8 idf_path <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") # v8.8 # if neither EnergyPlus v8.8 nor Idd v8.8 was found, error will occur # if EnergyPlus v8.8 is found but Idd v8.8 was not, `Energy+.idd` in EnergyPlus # installation folder will be used for pasing # if Idd v8.8 is found, it will be used automatically is_avail_eplus(8.8)
#> [1] TRUE
#> [1] TRUE
read_idf(idf_path)
#> ── EnergPlus Input Data File ─────────────────────────────────────────────────── #> * Path: '/tmp/RtmpaSlPu9/temp_libpath61fd4b9ed3f/eplusr/extdata/1ZoneUncon... #> * Version: '8.8.0' #> #> Group: <Simulation Parameters> #> ├─ [01<O>] Class: <Version> #> │─ [01<O>] Class: <SimulationControl> #> │─ [01<O>] Class: <Building> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Inside> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Outside> #> │─ [01<O>] Class: <HeatBalanceAlgorithm> #> └─ [01<O>] Class: <Timestep> #> #> Group: <Location and Climate> #> ├─ [01<O>] Class: <Site:Location> #> │─ [02<O>] Class: <SizingPeriod:DesignDay> #> └─ [01<O>] Class: <RunPeriod> #> #> Group: <Schedules> #> ├─ [02<O>] Class: <ScheduleTypeLimits> #> └─ [01<O>] Class: <Schedule:Constant> #> #> Group: <Surface Construction Elements> #> ├─ [01<O>] Class: <Material> #> │─ [02<O>] Class: <Material:NoMass> #> └─ [03<O>] Class: <Construction> #> #> Group: <Thermal Zones and Surfaces> #> ├─ [01<O>] Class: <GlobalGeometryRules> #> │─ [01<O>] Class: <Zone> #> └─ [06<O>] Class: <BuildingSurface:Detailed> #> #> Group: <Internal Gains> #> └─ [02<O>] Class: <OtherEquipment> #> #> Group: <Exterior Equipment> #> └─ [01<O>] Class: <Exterior:Lights> #> #> Group: <Output Reporting> #> ├─ [01<O>] Class: <Output:VariableDictionary> #> │─ [01<O>] Class: <Output:Surfaces:Drawing> #> │─ [01<O>] Class: <Output:Constructions> #> │─ [01<O>] Class: <Output:Table:SummaryReports> #> │─ [01<O>] Class: <OutputControl:Table:Style> #> │─ [14<O>] Class: <Output:Variable> #> └─ [03<O>] Class: <Output:Meter:MeterFileOnly>
# argument `idd` can be specified explicitly using `use_idd()` read_idf(idf_path, idd = use_idd(8.8))
#> ── EnergPlus Input Data File ─────────────────────────────────────────────────── #> * Path: '/tmp/RtmpaSlPu9/temp_libpath61fd4b9ed3f/eplusr/extdata/1ZoneUncon... #> * Version: '8.8.0' #> #> Group: <Simulation Parameters> #> ├─ [01<O>] Class: <Version> #> │─ [01<O>] Class: <SimulationControl> #> │─ [01<O>] Class: <Building> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Inside> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Outside> #> │─ [01<O>] Class: <HeatBalanceAlgorithm> #> └─ [01<O>] Class: <Timestep> #> #> Group: <Location and Climate> #> ├─ [01<O>] Class: <Site:Location> #> │─ [02<O>] Class: <SizingPeriod:DesignDay> #> └─ [01<O>] Class: <RunPeriod> #> #> Group: <Schedules> #> ├─ [02<O>] Class: <ScheduleTypeLimits> #> └─ [01<O>] Class: <Schedule:Constant> #> #> Group: <Surface Construction Elements> #> ├─ [01<O>] Class: <Material> #> │─ [02<O>] Class: <Material:NoMass> #> └─ [03<O>] Class: <Construction> #> #> Group: <Thermal Zones and Surfaces> #> ├─ [01<O>] Class: <GlobalGeometryRules> #> │─ [01<O>] Class: <Zone> #> └─ [06<O>] Class: <BuildingSurface:Detailed> #> #> Group: <Internal Gains> #> └─ [02<O>] Class: <OtherEquipment> #> #> Group: <Exterior Equipment> #> └─ [01<O>] Class: <Exterior:Lights> #> #> Group: <Output Reporting> #> ├─ [01<O>] Class: <Output:VariableDictionary> #> │─ [01<O>] Class: <Output:Surfaces:Drawing> #> │─ [01<O>] Class: <Output:Constructions> #> │─ [01<O>] Class: <Output:Table:SummaryReports> #> │─ [01<O>] Class: <OutputControl:Table:Style> #> │─ [14<O>] Class: <Output:Variable> #> └─ [03<O>] Class: <Output:Meter:MeterFileOnly>
# you can set `download` arugment to "auto" in `use_idd()` if you want to # automatically download corresponding IDD file when necessary read_idf(idf_path, use_idd(8.8, download = "auto"))
#> ── EnergPlus Input Data File ─────────────────────────────────────────────────── #> * Path: '/tmp/RtmpaSlPu9/temp_libpath61fd4b9ed3f/eplusr/extdata/1ZoneUncon... #> * Version: '8.8.0' #> #> Group: <Simulation Parameters> #> ├─ [01<O>] Class: <Version> #> │─ [01<O>] Class: <SimulationControl> #> │─ [01<O>] Class: <Building> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Inside> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Outside> #> │─ [01<O>] Class: <HeatBalanceAlgorithm> #> └─ [01<O>] Class: <Timestep> #> #> Group: <Location and Climate> #> ├─ [01<O>] Class: <Site:Location> #> │─ [02<O>] Class: <SizingPeriod:DesignDay> #> └─ [01<O>] Class: <RunPeriod> #> #> Group: <Schedules> #> ├─ [02<O>] Class: <ScheduleTypeLimits> #> └─ [01<O>] Class: <Schedule:Constant> #> #> Group: <Surface Construction Elements> #> ├─ [01<O>] Class: <Material> #> │─ [02<O>] Class: <Material:NoMass> #> └─ [03<O>] Class: <Construction> #> #> Group: <Thermal Zones and Surfaces> #> ├─ [01<O>] Class: <GlobalGeometryRules> #> │─ [01<O>] Class: <Zone> #> └─ [06<O>] Class: <BuildingSurface:Detailed> #> #> Group: <Internal Gains> #> └─ [02<O>] Class: <OtherEquipment> #> #> Group: <Exterior Equipment> #> └─ [01<O>] Class: <Exterior:Lights> #> #> Group: <Output Reporting> #> ├─ [01<O>] Class: <Output:VariableDictionary> #> │─ [01<O>] Class: <Output:Surfaces:Drawing> #> │─ [01<O>] Class: <Output:Constructions> #> │─ [01<O>] Class: <Output:Table:SummaryReports> #> │─ [01<O>] Class: <OutputControl:Table:Style> #> │─ [14<O>] Class: <Output:Variable> #> └─ [03<O>] Class: <Output:Meter:MeterFileOnly>
# Besides use a path to an IDF file, you can also provide IDF in literal # string format idf_string <- " Version, 8.8; Building, Building; !- Name " read_idf(idf_string, use_idd(8.8, download = "auto"))
#> ── EnergPlus Input Data File ─────────────────────────────────────────────────── #> * Path: NOT LOCAL #> * Version: '8.8.0' #> #> Group: <Simulation Parameters> #> ├─ [1<O>] Class: <Version> #> └─ [1<O>] Class: <Building>
# }