# natlabrockies/openstudio-hpxml architecture

> Architecture diagram of the GitHub repository natlabrockies/openstudio-hpxml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/natlabrockies/openstudio-hpxml
- Repository: https://github.com/natlabrockies/openstudio-hpxml

## Overview

OpenStudio-HPXML turns residential building descriptions in HPXML into EnergyPlus simulations, with measures for generating HPXML and detailed schedules and for reporting simulation results and utility bills. The main workflow is building input → HPXML → OpenStudio model → EnergyPlus simulation → reports. The graph also preserves documented modeling, sizing, validation, schedule, and billing capabilities. Some subsystem links rely on the README because their source was not sampled; those relationships are cited as documented rather than inferred from filenames.

Main entry points: [`HPXMLtoOpenStudio/measure.rb`](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/measure.rb) (HPXML translator), [`workflow/run_simulation.rb`](https://github.com/natlabrockies/openstudio-hpxml/blob/master/workflow/run_simulation.rb) (Simulation workflow), [`BuildResidentialHPXML/measure.rb`](https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialHPXML/measure.rb) (Build HPXML), [`HPXMLtoOpenStudio/resources/meta_measure.rb`](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/meta_measure.rb) (Measure orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Input generation"]
  node_build_hpxml["Build HPXML<br/>[measure.rb]"]
  node_geometry["Geometry inputs<br/>[geometry.rb]"]
  node_schedule_measure["Build schedules<br/>[measure.rb]"]
  node_schedules["Schedule generation<br/>[schedules.rb]"]
end

subgraph group_translation["Model translation"]
  node_hpxml["HPXML description<br/>[hpxml.rb]"]
  node_validation["Schema validation<br/>[xmlvalidator.rb]"]
  node_translator["HPXML translator<br/>[measure.rb]"]
  node_defaults["Input defaults<br/>[defaults.rb]"]
  node_model["OpenStudio model<br/>[model.rb]"]
end

subgraph group_simulation["Simulation"]
  node_workflow["Simulation workflow<br/>[run_simulation.rb]"]
  node_orchestration["Measure orchestration<br/>[meta_measure.rb]"]
  node_energyplus["EnergyPlus execution<br/>[energyplus.rb]"]
end

subgraph group_reporting["Reporting"]
  node_utility_calcs["Utility bill calculations<br/>[util.rb]"]
  node_simulation_report["Simulation reporting<br/>[measure.rb]"]
  node_output_helpers["Output processing<br/>[output.rb]"]
  node_utility_report["Utility bill reporting<br/>[measure.rb]"]
end

subgraph group_support["Modeling capabilities"]
  node_building_systems["Building systems<br/>[hvac.rb]"]
  node_envelope["Envelope construction<br/>[constructions.rb]"]
  node_sizing["HVAC sizing<br/>[hvac_sizing.rb]"]
  node_schedule_model["Model schedules<br/>[schedules.rb]"]
  node_location["Weather and location<br/>[location.rb]"]
end

node_user(("Workflow user"))
node_energyplus_service["EnergyPlus"]

node_user -->|"provides inputs"| node_build_hpxml
node_build_hpxml -->|"uses geometry"| node_geometry
node_build_hpxml -->|"generates HPXML"| node_hpxml
node_user -->|"requests schedules"| node_schedule_measure
node_schedule_measure -->|"generates schedules"| node_schedules
node_schedules -.->|"supplies schedules"| node_workflow
node_user -->|"runs simulation"| node_workflow
node_workflow -->|"reads input"| node_hpxml
node_workflow -->|"runs measures"| node_orchestration
node_orchestration -->|"runs measure"| node_translator
node_hpxml -.->|"validates input"| node_validation
node_translator -->|"creates model"| node_model
node_translator -.->|"applies defaults"| node_defaults
node_translator -->|"models systems"| node_building_systems
node_translator -->|"models envelope"| node_envelope
node_translator -->|"sizes equipment"| node_sizing
node_translator -->|"uses schedules"| node_schedule_model
node_translator -.->|"sets location"| node_location
node_orchestration -->|"executes simulation"| node_energyplus
node_energyplus -->|"runs model"| node_energyplus_service
node_energyplus_service -->|"provides results"| node_simulation_report
node_simulation_report -->|"writes outputs"| node_output_helpers
node_user -->|"requests reports"| node_simulation_report
node_energyplus_service -->|"provides meter data"| node_utility_report
node_utility_report -->|"calculates bills"| node_utility_calcs
node_user -->|"requests bills"| node_utility_report

click node_build_hpxml "https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialHPXML/measure.rb"
click node_geometry "https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialHPXML/resources/geometry.rb"
click node_schedule_measure "https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialScheduleFile/measure.rb"
click node_schedules "https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialScheduleFile/resources/schedules.rb"
click node_hpxml "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/hpxml.rb"
click node_validation "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/xmlvalidator.rb"
click node_translator "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/measure.rb"
click node_defaults "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/defaults.rb"
click node_model "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/model.rb"
click node_building_systems "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/hvac.rb"
click node_envelope "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/constructions.rb"
click node_sizing "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/hvac_sizing.rb"
click node_schedule_model "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/schedules.rb"
click node_location "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/location.rb"
click node_utility_calcs "https://github.com/natlabrockies/openstudio-hpxml/blob/master/ReportUtilityBills/resources/util.rb"
click node_workflow "https://github.com/natlabrockies/openstudio-hpxml/blob/master/workflow/run_simulation.rb"
click node_orchestration "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/meta_measure.rb"
click node_energyplus "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/energyplus.rb"
click node_simulation_report "https://github.com/natlabrockies/openstudio-hpxml/blob/master/ReportSimulationOutput/measure.rb"
click node_output_helpers "https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/output.rb"
click node_utility_report "https://github.com/natlabrockies/openstudio-hpxml/blob/master/ReportUtilityBills/measure.rb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_build_hpxml,node_geometry,node_schedule_measure,node_schedules,node_user toneBlue
class node_hpxml,node_validation,node_translator,node_defaults,node_model toneAmber
class node_workflow,node_orchestration,node_energyplus toneMint
class node_utility_calcs,node_simulation_report,node_output_helpers,node_utility_report toneRose
class node_building_systems,node_envelope,node_sizing,node_schedule_model,node_location,node_energyplus_service toneIndigo
```

## Components

### Input generation

- [Build HPXML](https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialHPXML/measure.rb): `BuildResidentialHPXML/measure.rb`
- [Geometry inputs](https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialHPXML/resources/geometry.rb): `BuildResidentialHPXML/resources/geometry.rb`
- [Build schedules](https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialScheduleFile/measure.rb): `BuildResidentialScheduleFile/measure.rb`
- [Schedule generation](https://github.com/natlabrockies/openstudio-hpxml/blob/master/BuildResidentialScheduleFile/resources/schedules.rb): `BuildResidentialScheduleFile/resources/schedules.rb`

### Model translation

- [HPXML description](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/hpxml.rb): `HPXMLtoOpenStudio/resources/hpxml.rb`
- [Schema validation](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/xmlvalidator.rb): `HPXMLtoOpenStudio/resources/xmlvalidator.rb`
- [HPXML translator](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/measure.rb): `HPXMLtoOpenStudio/measure.rb`
- [Input defaults](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/defaults.rb): `HPXMLtoOpenStudio/resources/defaults.rb`
- [OpenStudio model](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/model.rb): `HPXMLtoOpenStudio/resources/model.rb`

### Simulation

- [Simulation workflow](https://github.com/natlabrockies/openstudio-hpxml/blob/master/workflow/run_simulation.rb): `workflow/run_simulation.rb`
- [Measure orchestration](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/meta_measure.rb): `HPXMLtoOpenStudio/resources/meta_measure.rb`
- [EnergyPlus execution](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/energyplus.rb): `HPXMLtoOpenStudio/resources/energyplus.rb`

### Reporting

- [Utility bill calculations](https://github.com/natlabrockies/openstudio-hpxml/blob/master/ReportUtilityBills/resources/util.rb): `ReportUtilityBills/resources/util.rb`
- [Simulation reporting](https://github.com/natlabrockies/openstudio-hpxml/blob/master/ReportSimulationOutput/measure.rb): `ReportSimulationOutput/measure.rb`
- [Output processing](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/output.rb): `HPXMLtoOpenStudio/resources/output.rb`
- [Utility bill reporting](https://github.com/natlabrockies/openstudio-hpxml/blob/master/ReportUtilityBills/measure.rb): `ReportUtilityBills/measure.rb`

### Modeling capabilities

- [Building systems](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/hvac.rb): `HPXMLtoOpenStudio/resources/hvac.rb`
- [Envelope construction](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/constructions.rb): `HPXMLtoOpenStudio/resources/constructions.rb`
- [HVAC sizing](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/hvac_sizing.rb): `HPXMLtoOpenStudio/resources/hvac_sizing.rb`
- [Model schedules](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/schedules.rb): `HPXMLtoOpenStudio/resources/schedules.rb`
- [Weather and location](https://github.com/natlabrockies/openstudio-hpxml/blob/master/HPXMLtoOpenStudio/resources/location.rb): `HPXMLtoOpenStudio/resources/location.rb`

### Other components

- **Workflow user**
- **EnergyPlus**

## Connections

- Workflow user → Build HPXML: provides inputs
- Build HPXML → Geometry inputs: uses geometry
- Build HPXML → HPXML description: generates HPXML
- Workflow user → Build schedules: requests schedules
- Build schedules → Schedule generation: generates schedules
- Schedule generation → Simulation workflow: supplies schedules
- Workflow user → Simulation workflow: runs simulation
- Simulation workflow → HPXML description: reads input (evidence: `workflow/run_simulation.rb`)
- Simulation workflow → Measure orchestration: runs measures (evidence: `HPXMLtoOpenStudio/resources/meta_measure.rb`)
- Measure orchestration → HPXML translator: runs measure (evidence: `HPXMLtoOpenStudio/resources/meta_measure.rb`)
- HPXML description → Schema validation: validates input
- HPXML translator → OpenStudio model: creates model
- HPXML translator → Input defaults: applies defaults
- HPXML translator → Building systems: models systems
- HPXML translator → Envelope construction: models envelope
- HPXML translator → HVAC sizing: sizes equipment
- HPXML translator → Model schedules: uses schedules
- HPXML translator → Weather and location: sets location
- Measure orchestration → EnergyPlus execution: executes simulation (evidence: `HPXMLtoOpenStudio/resources/meta_measure.rb`)
- EnergyPlus execution → EnergyPlus: runs model
- EnergyPlus → Simulation reporting: provides results
- Simulation reporting → Output processing: writes outputs (evidence: `ReportSimulationOutput/measure.rb`)
- Workflow user → Simulation reporting: requests reports
- EnergyPlus → Utility bill reporting: provides meter data
- Utility bill reporting → Utility bill calculations: calculates bills (evidence: `ReportUtilityBills/measure.rb`)
- Workflow user → Utility bill reporting: requests bills
