Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
# Pinned commit (buildingsync-measures-gem develop, includes PR #6) of the sibling checkout
# that config/external_measure_repos.yml loads via local_path.
BSYNC_MEASURES_REF: 57eec35b4d1d0c36dca3de2181a0164c35e75bd7

jobs:
unit:
name: unit
Expand All @@ -25,17 +30,29 @@ jobs:
env:
LANG: C.UTF-8
LC_ALL: C.UTF-8
defaults:
run:
working-directory: BOSS
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
path: BOSS
# Not released as a gem; config/external_measure_repos.yml loads it from ../buildingsync-measures-gem.
- name: Checkout buildingsync-measures-gem
uses: actions/checkout@v4
with:
repository: BuildingSync/buildingsync-measures-gem
ref: ${{ env.BSYNC_MEASURES_REF }}
path: buildingsync-measures-gem
- name: Cache gems
uses: actions/cache@v4
with:
path: .bundle/install
key: gems-${{ runner.os }}-os3.10.0-${{ hashFiles('Gemfile.lock', '*.gemspec') }}
key: gems-${{ runner.os }}-os3.10.0-${{ hashFiles('BOSS/Gemfile.lock', 'BOSS/*.gemspec') }}
- name: Setup
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory '*'
gem install bundler -v 2.4.10
bundle config set --local path "$GITHUB_WORKSPACE/.bundle/install"
bundle install
Expand Down Expand Up @@ -90,19 +107,30 @@ jobs:
LC_ALL: C.UTF-8
BOSS_SHARD: ${{ matrix.shard }}
BOSS_SHARDS: '4'
defaults:
run:
working-directory: BOSS
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
path: BOSS
- name: Checkout buildingsync-measures-gem
uses: actions/checkout@v4
with:
repository: BuildingSync/buildingsync-measures-gem
ref: ${{ env.BSYNC_MEASURES_REF }}
path: buildingsync-measures-gem
- name: Cache gems
uses: actions/cache@v4
with:
path: .bundle/install
key: gems-${{ runner.os }}-os3.10.0-${{ hashFiles('Gemfile.lock', '*.gemspec') }}
key: gems-${{ runner.os }}-os3.10.0-${{ hashFiles('BOSS/Gemfile.lock', 'BOSS/*.gemspec') }}
- name: Cache external measures
uses: actions/cache@v4
with:
path: vendor/external_measures
key: ext-measures-${{ hashFiles('config/external_measure_repos.yml') }}
path: BOSS/vendor/external_measures
key: ext-measures-${{ hashFiles('BOSS/config/external_measure_repos.yml') }}
- name: Setup
run: |
git config --global --add safe.directory '*'
Expand All @@ -117,4 +145,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: integration-output-shard-${{ matrix.shard }}
path: spec/output
path: BOSS/spec/output
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The shipped manifest lives at [config/external_measure_repos.yml](config/externa

- local measure roots: `lib/measures` (first in precedence)
- external repository: comstock (`measures` and `resources/measures`)
- local checkout: `buildingsync-measures-gem` (`lib/measures`), expected as a sibling of this repository (`../buildingsync-measures-gem`). It is marked `scenario_only` and is added to `measure_paths` only for baselines that use an HVAC topology. CI pins its commit via `BSYNC_MEASURES_REF` in [.github/workflows/ci.yml](.github/workflows/ci.yml).

Measure path precedence is:

Expand All @@ -46,6 +47,40 @@ Measure path precedence is:

The generated `in.osw` will include these paths in order under `measure_paths`.

### Baseline HVAC

When the facility's detailed (L200) `HVACSystems` exactly match a supported topology, the baseline sets `create_typical_building_from_model`'s `add_hvac` to `false` and adds `apply_hvac_topology_to_zone_scope` (operation `create`) and `apply_standard_hvac_sizing_and_efficiency` from buildingsync-measures-gem. Supported templates are DOE Ref Pre-1980, DOE Ref 1980-2004, and 90.1-2004 through 90.1-2019. HVAC systems referenced by measures as proposed (`AlternativeSystemReplacement` or `ModifiedSystem`) are excluded from the baseline.

Configurations that can produce a topology baseline:

| Configuration | Topology measure |
|---|---|
| Packaged Terminal Air Conditioner | `hvac_ptac` |
| Packaged Terminal Heat Pump | `hvac_pthp` |
| Four Pipe Fan Coil Unit | `hvac_four_pipe_fan_coil` |
| Packaged Rooftop Air Conditioner | `hvac_packaged_rooftop_ac` |
| Packaged Rooftop Heat Pump | `hvac_packaged_rooftop_heat_pump` |
| Packaged Rooftop VAV with Hot Water Reheat | `hvac_packaged_rooftop_vav_hw_reheat` |
| VAV with Hot Water Reheat | `hvac_vav_hw_reheat` |
| Warm Air Furnace | `hvac_warm_air_furnace` |
| VRF Terminal Unit | `hvac_vrf` |

A Ventilation Only (`hvac_ventilation_only`) or Dedicated Outdoor Air System (`hvac_doas`) configuration can be added on top, but only alongside PTAC, PTHP, four-pipe fan coil, or VRF.

Recognized but not yet mapped (always fall back): Packaged Rooftop VAV with Electric Reheat, VAV with Electric Reheat, Water Loop Heat Pump, Ground Source Heat Pump, Chilled Beam, and hydronic radiant systems.

BOSS also falls back when:

- any selected `HVACSystem` does not match a supported configuration;
- there is not exactly one conditioning configuration, or there is more than one ventilation configuration;
- ventilation is paired with a conditioning type that does not allow it;
- the template is not supported;
- a system's premises are scoped to specific zones rather than the whole building (the baseline binds topologies to all model zones only).

On fallback, BOSS uses the `system_type` mapping below with `add_hvac` set to `true`, and logs a warning explaining why.

Integration simulations currently cover the packaged rooftop heat pump; the other configurations are covered by unit specs.

## OpenStudio Compatibility Version

| OpenStudio Version | BuildingSync Version | BOSS Version |
Expand Down Expand Up @@ -96,7 +131,7 @@ The table below maps in detail the BuildingSync XML data to measure inputs. Note
| | template | get_standard_template | either `.../Building/YearOfLastMajorRemodel` or `.../Building/YearOfConstruction` |
| | system_type | get_principal_HVAC_system_type | at least one mappable entry of `.../Systems/HVACSystems/HVACSystem/PrincipalHVACSystemType` |
| | add_swh | | Hard Coded to to true |
| | add_hvac | | Hard Coded to to true |
| | add_hvac | | `true` for fallback baselines; `false` when an HVAC topology is applied (see [Baseline HVAC](#baseline-hvac)) |
| [SetLightingLoadsByLPD] | | | |
| | lpd | get_total_installed_power | `/InstalledPower` in ALL instances of `.../Systems/LightingSystems/LightingSystem` |
| [set_electric_equipment_loads_by_epd] | | | |
Expand Down
13 changes: 13 additions & 0 deletions config/external_measure_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ local_measure_roots:
# - name: local checkout folder name under vendor/external_measures
# - url: git repository URL
# - ref: pinned tag/branch/commit to checkout
# - local_path (instead of url/ref): existing local checkout, relative to this file.
# BOSS uses it in place and never runs Git against it; a missing path is an error.
# - measure_roots: one or more paths inside the repo that contain measure directories
# - scenario_only (optional, default false): when true, measure roots are added only to
# workflows that opt in (baseline/in.osw with a detailed HVAC topology); fallback
# baselines omit them, so they do not require this checkout
#

# The below measures are needed for the BOSS L200 workflow.
Expand All @@ -25,3 +30,11 @@ repos:
measure_roots:
- measures
- resources/measures

# BuildingSync HVAC topology measures. Not released as a gem, so BOSS
# loads the sibling checkout ../buildingsync-measures-gem (CI pins its commit).
- name: buildingsync-measures-gem
local_path: ../../buildingsync-measures-gem
measure_roots:
- lib/measures
scenario_only: true
85 changes: 85 additions & 0 deletions docs/L200-baseline-HVAC-flowcharts/l200_baseline_hvac_flow.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
flowchart TD
START(["Boss.write_baseline_osw(xml, output, epw, standard)"]) --> BUILD["build_baseline_osw (private)"]
BUILD --> READ["BuildingSyncReader.get_hvac_systems_xml<br/>returns Facility/Systems/HVACSystems"]
READ --> NOSYS{"Planner: HVACSystems present?"}
NOSYS -- no --> FB
NOSYS -- yes --> TPL{"Template supported?<br/>DOE Ref Pre-1980, DOE Ref 1980-2004,<br/>90.1-2004 … 90.1-2019"}
TPL -- no --> FB
TPL -- yes --> SYS

subgraph SELECTOR["HvacTopologySelector.select: one status per Delivery and per OtherHVACSystem"]
SYS{"HVACSystem has Delivery or<br/>OtherHVACSystem records?"}
SYS -- "no (only Principal/PrimaryHVACSystemType)" --> MISS["status: missing_input"]
SYS -- yes --> DUP{"IDs unique?"}
DUP -- no --> R_CONF["status: conflicting_input"]
DUP -- yes --> SPLIT["Deliveries owned by a ventilation record are<br/>judged with that record, not as conditioning"]
SPLIT --> SEL["Each remaining Delivery: follow HeatingSourceID / CoolingSourceID<br/>→ sources → Heating / Cooling / Condenser plants"]
SEL --> REFOK{"References resolve; source IDs<br/>and premises present?"}
REFOK -- "broken / conflicting" --> R_CONF
REFOK -- "field missing" --> MISS
REFOK -- yes --> RULES{"DELIVERY_RULES + NOT_MAPPABLE_DELIVERY"}
RULES -- "one supported rule" --> GUARD{"Must-be-absent elements absent<br/>and guards pass?"}
GUARD -- no --> R_CONF
GUARD -- yes --> MATCH["status: match + measure:<br/>PTAC→hvac_ptac · PTHP→hvac_pthp<br/>RTU AC→hvac_packaged_rooftop_ac<br/>RTU HP→hvac_packaged_rooftop_heat_pump<br/>(supplemental_heating_fuel from HeatPumpBackupSystemFuel)<br/>Pkg VAV HW reheat · VAV HW reheat<br/>Warm air furnace · VRF · 4-pipe FCU"]
RULES -- "gap rule" --> GAP["status: mapping_gap<br/>VAV electric reheat, WLHP, GSHP,<br/>chilled beam, radiant"]
RULES -- "one not-mappable hit" --> NM["status: not_mappable<br/>split DX, split/mini/multi-split HP, SPVAC/SPVHP,<br/>field-assembled DX, 2-pipe fan coil, baseboard/radiator,<br/>heating-only or cooling-only pair, multizone CAV / CAV reheat,<br/>VAV no reheat, unsupported VAV reheat, UFAD, evaporative,<br/>steam/district/solar heat, absorption/district cooling,<br/>air-cooled chiller"]
RULES -- "more than one hit" --> R_CONF
RULES -- "no hit" --> MISS
SPLIT --> OTH["Each OtherHVACSystem"]
OTH --> EQ{"Spot exhaust, humidifier, dehumidifier,<br/>air cleaner, natural ventilation?"}
EQ -- yes --> NM
EQ -- no --> VENT{"VentilationType"}
VENT -- "missing" --> MISS
VENT -- "more than one" --> R_CONF
VENT -- "HRV / ERV / Exhaust only" --> NM
VENT -- "integrated with air distribution" --> INTEG["status: integrated<br/>(linked deliveries judged as conditioning)"]
VENT -- "None" --> ANNOT["status: no_hvac<br/>(explicitly no HVAC, or no separate<br/>ventilation equipment)"]
VENT -- "Supply only / DOAS" --> VCHK{"Links resolve and not shared?<br/>Deliveries unconditioned?<br/>Stand-alone, single-duct CAV?<br/>Guards pass?"}
VCHK -- "broken / shared link, guard fails" --> R_CONF
VCHK -- "deliveries heated or cooled" --> NM
VCHK -- "requirements not met" --> MISS
VCHK -- yes --> VMATCH["match: Supply only → hvac_ventilation_only<br/>DOAS → hvac_doas"]
MATCH --> PREM["Attach premises: record LinkedPremises,<br/>else inherit HVACSystem LinkedPremises"]
VMATCH --> PREM
end

PREM --> PROP
R_CONF --> PROP
GAP --> PROP
NM --> PROP
MISS --> PROP
INTEG --> PROP
ANNOT --> PROP

subgraph PLANNER["BaselineHvacPlanner.plan"]
PROP["Drop results of proposed systems<br/>(exclude_system_ids from a Measure's<br/>AlternativeSystemReplacement / ModifiedSystem)"]
PROP --> ANY{"Any results left?"}
ANY -- yes --> PLAN{"Every result is match?<br/>(any other status falls back,<br/>including integrated and no_hvac)"}
PLAN -- yes --> GROUP["Group by (measure, measure_arguments);<br/>merge premises; split into<br/>conditioning and ventilation"]
GROUP --> CFG{"Configuration checks (all reasons reported together):<br/>exactly 1 conditioning; at most 1 ventilation;<br/>if ventilation, conditioning is zone equipment<br/>(ptac, pthp, four_pipe_fan_coil, vrf)"}
CFG -- pass --> NORM["normalize_premises: Section links covering the building<br/>(Whole building section, or all non-empty sections)<br/>→ treated as Building"]
end

ANY -- no --> FB
PLAN -- no --> FB
CFG -- "any fails" --> FB

subgraph BINDER["HvacTargetBinder.bind (conditioning: given operation; ventilation: always create)"]
NORM --> WB{"Premises all Building / Site / Facility?<br/>(generated geometry has no BuildingSync zone IDs)"}
WB -- yes --> STEP["apply_hvac_topology_to_zone_scope step:<br/>topology_measure, operation create/replace,<br/>zone_scope = all_model_zones, standards_template,<br/>topology_arguments_json (only if measure arguments)"]
end
WB -- "no (zone/space premise)<br/>missing_input" --> FB

STEP --> SIZE["Steps: conditioning → ventilation →<br/>apply_standard_hvac_sizing_and_efficiency(template)"]
SIZE --> TOPO["Plan = :topology"]

TOPO --> OSW1["OSWArgPopulator:<br/>create_typical_building_from_model add_hvac = false<br/>append_step + set_step_argument (per step, no name collision)"]
OSW1 --> DIRS1["measure_paths include scenario_only repos<br/>(buildingsync-measures-gem via local_path ../../buildingsync-measures-gem)"]

FB["Plan = :fallback with reasons"] --> OSW2["create_typical_building_from_model add_hvac = true<br/>log warning per reason:<br/>'Keeping create_typical_building_from_model HVAC: …'"]
OSW2 --> DIRS2["measure_paths exclude scenario_only repos<br/>(sibling gem checkout not required)"]

DIRS1 --> WRITE["Write baseline/in.osw"]
DIRS2 --> WRITE
WRITE --> RUN["Boss.run_baseline_osw → OpenStudio workflow"]
RUN --> CHECK["Integration check (shard 0, non-smoke):<br/>Success, add_hvac=false, PSZ-HP loops w/ NaturalGas<br/>supplemental heat for template, sizing Success"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/L200-baseline-HVAC-flowcharts/l200_flow_0_overview.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
flowchart LR
A(["Boss.write_baseline_osw<br/><b>start the baseline OSW build</b>"]) --> B["1. Reader<br/>get_hvac_systems_xml<br/><b>read HVACSystems from BuildingSync</b>"]
B --> C["2. HvacTopologySelector<br/>one status per Delivery / OtherHVACSystem<br/><b>classify each HVAC record; match it to a measure</b>"]
C --> D["3. BaselineHvacPlanner<br/>skip proposed systems; all must match;<br/>one conditioning + optional ventilation<br/><b>decide L200 topology or L100 fallback</b>"]
D -- topology --> E["4. HvacTargetBinder<br/>whole-building premises → all model zones<br/><b>apply each measure to all model zones</b>"]
E --> F["5a. L200 OSW: add_hvac = false<br/>+ conditioning, ventilation, sizing steps<br/><b>build the audited HVAC system</b>"]
D -- "fallback to L100" --> G["5b. L100 OSW (generic HVAC workflow):<br/>add_hvac = true<br/>+ one warning per reason<br/><b>fall back to L100 generic HVAC, log why</b>"]
F --> H["6. Write in.osw and run OpenStudio<br/><b>simulate the baseline</b>"]
G --> H
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions docs/L200-baseline-HVAC-flowcharts/l200_flow_1_selector.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
flowchart TD
IN(["HVACSystems XML"]) --> SYS{"Each HVACSystem: has Delivery<br/>or OtherHVACSystem records?"}
SYS -- "no (only Principal/PrimaryHVACSystemType)" --> MISS
SYS -- yes --> DUP{"IDs unique?"}
DUP -- no --> R_CONF["conflicting_input"]
DUP -- yes --> SPLIT["Deliveries owned by a ventilation record<br/>are judged with that record, not as conditioning"]
SPLIT --> SEL["Each remaining Delivery: follow HeatingSourceID / CoolingSourceID<br/>→ sources → Heating / Cooling / Condenser plants"]
SEL --> REFOK{"References resolve; source IDs<br/>and premises present?"}
REFOK -- "broken / conflicting" --> R_CONF
REFOK -- "field missing" --> MISS
REFOK -- yes --> RULES{"DELIVERY_RULES + NOT_MAPPABLE_DELIVERY"}
RULES -- "one supported rule" --> GUARD{"Must-be-absent elements absent<br/>and guards pass?"}
GUARD -- no --> R_CONF
GUARD -- yes --> MATCH["match:<br/>PTAC→hvac_ptac · PTHP→hvac_pthp<br/>RTU AC→hvac_packaged_rooftop_ac<br/>RTU HP→hvac_packaged_rooftop_heat_pump<br/>(supplemental_heating_fuel from HeatPumpBackupSystemFuel)<br/>Pkg VAV HW reheat · VAV HW reheat<br/>Warm air furnace · VRF · 4-pipe FCU"]
RULES -- "gap rule" --> GAP["mapping_gap:<br/>VAV electric reheat, WLHP, GSHP,<br/>chilled beam, radiant"]
RULES -- "one not-mappable hit" --> NM["not_mappable:<br/>split DX, split/mini/multi-split HP, SPVAC/SPVHP,<br/>field-assembled DX, 2-pipe fan coil, baseboard/radiator,<br/>heating-only or cooling-only pair, multizone CAV / CAV reheat,<br/>VAV no reheat, unsupported VAV reheat, UFAD, evaporative,<br/>steam/district/solar heat, absorption/district cooling,<br/>air-cooled chiller"]
RULES -- "more than one hit" --> R_CONF
RULES -- "no hit" --> MISS["missing_input"]
SPLIT --> OTH["Each OtherHVACSystem"]
OTH --> EQ{"Spot exhaust, humidifier, dehumidifier,<br/>air cleaner, natural ventilation?"}
EQ -- yes --> NM
EQ -- no --> VENT{"VentilationType"}
VENT -- "missing" --> MISS
VENT -- "more than one" --> R_CONF
VENT -- "HRV / ERV / Exhaust only" --> NM
VENT -- "integrated with air distribution" --> INTEG["integrated<br/>(linked deliveries judged as conditioning)"]
VENT -- "None" --> ANNOT["no_hvac<br/>(explicitly no HVAC, or no separate<br/>ventilation equipment)"]
VENT -- "Supply only / DOAS" --> VCHK{"Links resolve and not shared?<br/>Deliveries unconditioned?<br/>Stand-alone, single-duct CAV?<br/>Guards pass?"}
VCHK -- "broken / shared link, guard fails" --> R_CONF
VCHK -- "deliveries heated or cooled" --> NM
VCHK -- "requirements not met" --> MISS
VCHK -- yes --> VMATCH["match: Supply only → hvac_ventilation_only<br/>DOAS → hvac_doas"]
MATCH --> PREM["Attach premises: own LinkedPremises,<br/>else inherit HVACSystem's"]
VMATCH --> PREM
PREM --> OUT(["Results → Planner"])
R_CONF --> OUT
GAP --> OUT
NM --> OUT
MISS --> OUT
INTEG --> OUT
ANNOT --> OUT
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading