OpenStudio Modeling Patterns

SkillAI & models

OpenStudio model object relationships, tool dependencies, and common error patterns. Use when building or modifying models to ensure correct tool ordering.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the OpenStudio Modeling Patterns skill

What this skill tells your AI

The instructions your AI receives, as published by natlabrockies/openstudio-mcp in .claude/skills/openstudio-patterns/SKILL.md and read by ahel’s review.

Object Dependency Graph

Objects must be created in dependency order. Arrows mean "must exist before."

Materials
  └─> Constructions
        └─> assign_construction_to_surface(...) — needs Surface + Construction

Spaces (geometry)
  ├─> Surfaces (auto-created by create_space_from_floor_print)
  │     └─> SubSurfaces (windows/doors on walls)
  └─> ThermalZones (assign spaces to zones)
        ├─> HVAC Systems (zones must exist before add_baseline_system)
        │     ├─> AirLoopHVAC (systems 3-8)
        │     ├─> ZoneHVACEquipment (systems 1-2, 9-10)
        │     └─> PlantLoops (systems 5, 7-8: HW/CHW/condenser)
        └─> Loads (people, lights, equipment → assigned to spaces in zones)

Schedules (referenced by loads, thermostats)

Weather (EPW + design days, needed before simulation)

Typical Model Build Order

  1. Create or load modelcreate_new_building (recommended) / load_osm_model / create_bar_building
  2. Geometrycreate_space_from_floor_print (preferred) or create_space + create_surface
  3. Match surfacesmatch_surfaces after all spaces created (finds shared walls)
  4. Thermal zonescreate_thermal_zone with space_names
  5. Envelopecreate_standard_opaque_materialcreate_constructionassign_construction_to_surface (new assemblies only; to upgrade an EXISTING assembly use add_layer_to_construction, which preserves its layers)
  6. Glazingset_window_to_wall_ratio or create_subsurface
  7. Schedulescreate_schedule_ruleset (needed by loads)
  8. Loadscreate_people_definition, create_lights_definition, create_electric_equipment
  9. HVACcreate_typical_building(system_type=..., hvac_only=True) for standards-tuned systems (decision-grade results); add_baseline_system / add_doas_system / add_vrf_system for explicit generic wiring control
  10. Weatherchange_building_location (sets EPW + design days + climate zone in one call)
  11. Simulation controlset_run_period, set_simulation_control
  12. Save & simulatesave_osm_modelrun_simulation
  13. Resultsextract_summary_metrics, extract_end_use_breakdown, etc.

Model Object Relationships

Space

  • Belongs to: ThermalZone (optional), BuildingStory (optional), SpaceType (optional)
  • Contains: Surfaces, People, Lights, ElectricEquipment, GasEquipment, Infiltration
  • Key: A space without a ThermalZone won't participate in simulation

ThermalZone

  • Contains: 1+ Spaces
  • Connected to: AirLoopHVAC (optional), ZoneHVACEquipment (optional)
  • Has: ThermostatSetpointDualSetpoint (heating + cooling schedules)
  • Key: A zone without HVAC equipment gets no conditioning

Surface

  • Belongs to: Space
  • Has: Construction (optional), AdjacentSurface (for interior walls)
  • Contains: SubSurfaces (windows, doors)
  • Types: Wall, Floor, RoofCeiling
  • Boundary conditions: Outdoors, Ground, Surface (interior)

Construction

  • Ordered list of Material layers (outside to inside)
  • Referenced by: Surfaces, SubSurfaces, DefaultConstructionSets

AirLoopHVAC

  • Supply side: Fan, Cooling Coil, Heating Coil, OutdoorAirSystem
  • Demand side: AirTerminals (one per zone), zone connections
  • Serves: 1+ ThermalZones

PlantLoop

  • Types: Hot Water, Chilled Water, Condenser
  • Supply: Boiler/Chiller/CoolingTower + Pump
  • Demand: Coils from air loops or zone equipment

When to Use Which Creation Tool

GoalToolNotes
Production building modelcreate_new_buildingEnd-to-end: geometry + weather + HVAC + loads. Recommended starting point.
Custom geometry onlycreate_bar_buildingBar geometry from building type/area. Follow with create_typical_building for loads+HVAC.
Custom floor plancreate_space_from_floor_printExtrude polygon into 3D space. Use for non-rectangular geometry.
Standards template on existing geometrycreate_typical_buildingAdds constructions + loads + HVAC + schedules to model with geometry.
Import from FloorSpaceJSimport_floorspacejsLoad custom geometry JSON, then create_typical_building for loads+HVAC.
Quick test (1 zone, no HVAC)create_example_osmTesting/demos only.
Baseline test (10 zones)create_baseline_osmTesting/demos only.

Pre-Simulation Checklist

Before run_simulation, call validate_model to verify:

  • Weather file set (EPW)
  • Design days present (from DDY)
  • HVAC assigned to zones
  • Constructions on surfaces

HVAC Measure Authoring

Before writing measures that create HVAC objects:

search_api("CoilCoolingFourPipeBeam")       # verify real method names
search_wiring_patterns("four pipe beam")     # get working connection code

Common Error Patterns

ErrorCauseFix
"No model loaded"Called a query/creation tool before loadingload_osm_model or create_example_osm first
"Space 'X' not found"Typo or space not yet createdCheck list_spaces for exact names
"Thermal zone 'X' not found"Zone name mismatch in HVAC toolCheck list_thermal_zones for exact names
"Material 'X' not found"Creating construction with nonexistent materialcreate_standard_opaque_material first
"system_type must be 1-10"Invalid system numberCheck list_baseline_systems
Simulation fails, no resultsMissing weather file or design dayschange_building_location (sets EPW + DDY + climate zone)
EUI = 0 or unreasonableNo loads, no HVAC, or no run periodCheck inspect_osm_summary for missing objects
"Output directory is not allowed" / "... path not allowed"Path outside your allowed roots (over HTTP each user is scoped to /runs/<user>/)Save with save_osm_model(save_name=...) and reuse the paths tools return; staged inputs are read-only
[BUG] Segmentation fault ... in addToNode, measure process exits 134 (crash_marker set, no Ruby exception)Node handle captured before component.remove(); remove() deletes the component's outlet nodeaddToNode the new component on the old one's inlet node first, then remove(); search_wiring_patterns("replace coil")

Save vs Simulate

  • save_osm_model — persists model to disk (.osm file)
  • run_simulation — takes an OSM path + optional EPW, runs EnergyPlus in a background process
  • The in-memory model and the on-disk file are separate — save before simulating if you've made changes
  • Simulation results go to /runs/<run_id>/

Signals

GitHub stars
33
Forks
8
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
openstudio-patterns
Source
github.com/natlabrockies/openstudio-mcp