Skip to content

L200 baseline HVAC workflow - #33

Open
JieXiong9119 wants to merge 29 commits into
developfrom
l200-baseline-hvac
Open

JieXiong9119 wants to merge 29 commits into
developfrom
l200-baseline-hvac

Conversation

@JieXiong9119

@JieXiong9119 JieXiong9119 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds L200 HVAC topology construction to the baseline: when a BuildingSync file's existing HVAC system exactly matches a supported topology, BOSS builds that topology instead of relying on create_typical_building_from_model's generic HVAC. All other cases keep today's fallback behavior.

This pulls the baseline + HVAC part of scenario-workflow branch (up to #30) into develop on its own, ahead of the package-scenario work. Scenario mapping, scenario OSW writing/running, modifier binding, and retrofit fixtures stay on scenario-workflow.

Behavior

  • Topology baseline: when every non-proposed HVACSystem exactly matches one supported configuration (PTAC, PTHP, four-pipe fan coil, packaged rooftop AC/heat pump, packaged rooftop VAV or VAV with hot-water reheat, warm air furnace, VRF; optionally plus ventilation-only/DOAS with zone equipment) that serves the whole building:
    • create_typical_building_from_model gets add_hvac: false
    • apply_hvac_topology_to_zone_scope (create, all_model_zones) then apply_standard_hvac_sizing_and_efficiency are added
    • buildingsync-measures-gem measure paths are added to measure_paths
    • Simulation coverage in this PR: packaged rooftop heat pump (2 fixtures); the other configurations are covered by selector/planner/binder unit specs.
  • Fallback baseline (no match or unsupported template): add_hvac: true, existing system_type mapping, a logged warning, and no dependency on the sibling checkout. Verified byte-identical in.osw against develop for building_151 and all_measures_applied_example.
  • No changes to public APIs, CLI commands/options, runner inputs, or the baseline/in.osw layout.

Changes

  • OswArgPopulator: append_step, set_step_argument, step_argument_setter, add_hvac: keyword (default true)
  • ExternalMeasureRepoManager + config/external_measure_repos.yml: local_path sources (used in place, never touched by Git; missing path is an actionable error) and the scenario_only / include_scenario_only gate so only topology baselines need ../buildingsync-measures-gem
  • BuildingSyncReader#get_hvac_systems_xml
  • New HvacTopologySelector, BaselineHvacPlanner (incl. proposed_system_ids, moved from ScenarioHvacPlanner), and HvacTargetBinder (topology binding only; bind_modifier intentionally omitted)
  • Boss.write_baseline_osw refactored onto private build_baseline_osw; run_baseline_osw unchanged
  • Fixtures: example-smalloffice-level2.xml, example-smalloffice-level2-built-2012.xml
  • CI checks out buildingsync-measures-gem as a sibling at the pinned ref in the unit and integration jobs; paths/caches/artifacts adjusted for the BOSS/ subfolder. Shards, smoke selection, and docs-only gates unchanged.
  • Two topology baseline integration examples (DOE Ref 1980-2004, 90.1-2013), run on shard 0 only and skipped with BOSS_SMOKE=1
  • README: "Baseline HVAC" section, sibling-checkout setup, add_hvac row updated

Testing

  • bundle exec rspec spec/tests/unit — 152 examples, 0 failures
  • Fallback OSW parity with develop (building_151, all_measures_applied_example) — identical
  • bundle exec rake measures:install_external + rspec spec/tests/integration/write_and_run_osws_spec.rb -e "topology HVAC baseline" — 2 examples, 0 failures (both simulations Success)
  • git diff --check — clean
  • Full integration suite / shards — via CI
  • RuboCop

Local setup

git clone https://github.com/BuildingSync/buildingsync-measures-gem.git ../buildingsync-measures-gem
git -C ../buildingsync-measures-gem checkout 57eec35

Only needed for topology baselines and the related specs.

@JieXiong9119 JieXiong9119 self-assigned this Nov 18, 2026
@JieXiong9119

JieXiong9119 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Notes:

  • This PR can't merge into develop until upstream buildingsync-measures-gem PR #6 merges and the BSYNC_MEASURES_REF pin in CI points to the merged commit.
  • After this merges, update scenario-workflow so ScenarioHvacPlanner.proposed_system_ids calls the copy that now lives in BaselineHvacPlanner.

@JieXiong9119
JieXiong9119 requested a review from kflemin November 18, 2026 16:52
@JieXiong9119
JieXiong9119 added this pull request to stack #36 November 24, 2026 20:30
@JieXiong9119

Copy link
Copy Markdown
Contributor Author

How to review this PR

Tier 1: core (please review carefully)

These define the behavior. Every other configuration reuses them.

  • lib/BOSS/hvac_topology_selector.rb
    • Context path helpers (nodes, eq, guard, ref_ids, resolve_one): how BuildingSync is read
    • _select_system, _select_delivery, _index, _premises, _group_key, _result: selection flow and result shape
    • ONE rule row as the reference example: Packaged Rooftop Heat Pump
      (required / absent / guards / arguments)
  • lib/BOSS/baseline_hvac_planner.rb: results → OSW steps; any non-:match result → fallback
  • lib/BOSS/hvac_target_binder.rb, boss.rb#build_baseline_osw: wiring into the OSW
  • Spec: hvac_topology_selector_spec.rb sections for RTU HP + fallback

Tier 2: same pattern, skim

Each is one more row in the same schema. Check the BuildingSync values against
HVAC_MAPPING_AND_MIGRATION.md in buildingsync-measures-gem.

  • DELIVERY_RULES match rows: PTAC, PTHP, FCU, RTU AC, VAV variants, furnace, VRF
  • VENTILATION_MEASURES + planner ventilation pairing (DOAS / ventilation-only)

Tier 3: diagnostics only (no effect on the OSW)

These only change log messages. All of them fall back to the template (L100 or lower) baseline.

  • Gap rows, NOT_MAPPABLE_*, OTHER_EQUIPMENT_NOT_MAPPABLE, INTEGRATED
  • Statuses other than match / missing_input / conflicting_input

Tier 4: generated or supporting, no line-by-line review needed

  • spec/files/v2.7.0/l200_hvac/*.xml: generated by generate.rb
  • docs/L200-baseline-HVAC-flowcharts/*.mmd
  • Integration topology_configs: each fixture simulates end to end in CI

kflemin and others added 4 commits December 4, 2026 11:47
…seline

Add heating with terminal cooling mapping to L200 baseline

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in PR #37 (heating with terminal cooling mapping), merged into its stacked base add-erv-mapping-to-baseline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integrated outdoor-air records and MechanicalVentilation records with
VentilationType None or no type sent otherwise good L200 files to the
create_typical fallback, although the buildingsync-measures-gem mapping
doc (rows 88 and 89) says they should not block the conditioning match.

Selector results now carry two new fields. `blocking` is nil for a
blocking result and false for a note; `basis` is :doc, :policy or
:approximation. _check_result enforces the combinations that make sense.

- Row 88: integrated outdoor air, for any VentilationType except DOAS,
  is a non-blocking :doc note. Links, if any, must resolve.
- Row 89: None or untyped on conditioned deliveries is a non-blocking :doc
  note, and every MechanicalVentilation child is read as an annotation.
  Several such records may share a conditioned delivery. A record that
  links only unconditioned ventilation deliveries blocks.
- Row 87: None on deliveries that are all explicitly unconditioned stays
  blocking, now with a real message.
- Unknown is read as untyped by policy (:policy); Other stays blocking.
- ComStock recovery (row 83) is a :policy match.
- #37's pair-only absorption is replaced by these general rules, so every
  OtherHVACSystem gives its own result again.

The planner keeps notes in a new Plan#notes on both topology and fallback
plans. Plan#note_entries deduplicates them, marks matches on a fallback
"(not applied)", and logs :doc at INFO and :policy/:approximation at WARN.
hvac_mapping_report.json gains `allow_approximations` and `notes`.

New CLI option --[no-]allow_approximations (default on).
--no-allow_approximations keeps the mapping doc's blocking rules: ComStock
recovery becomes not_mappable and Unknown blocks.

No fixture changes plan status. About ten Audit Template and ASHRAE files
move their None/untyped records from fallback reasons to notes; they still
fall back for other reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Report non-blocking HVAC notes instead of falling back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants