Spaces:
Sleeping
Sleeping
| """ | |
| BuildSustain - Internal Loads Default Data | |
| This module handles the internal loads default data for the BuildSustain application. | |
| Developed by: Dr Majed Abuseif, Deakin University | |
| © 2025 | |
| """ | |
| import streamlit as st | |
| # People activity levels data as provided by user | |
| PEOPLE_ACTIVITY_LEVELS = { | |
| name: { | |
| "metabolic_rate_met": data[0], | |
| "metabolic_rate_w": data[1], | |
| "sensible_min_w": data[2], | |
| "sensible_max_w": data[3], | |
| "latent_min_w": data[4], | |
| "latent_max_w": data[5] | |
| } for name, data in [ | |
| ("Seated, at Rest (Quiet, Reading, Writing)", [1.0, 110, 20, 24, 9, 12]), | |
| ("Seated, Light Office Work (Typing, Filing)", [1.1, 125, 24, 27, 12, 15]), | |
| ("Standing, Light Work (Filing, Walking Slowly)", [1.35, 155, 30, 35, 18, 24]), | |
| ("Walking, Moderate Pace (2–3 mph / 3.2–4.8 km/h)", [2.0, 210, 41, 47, 30, 35]), | |
| ("Light Machine Work (Assembly, Small Tools)", [2.35, 250, 47, 56, 35, 44]), | |
| ("Moderate Work (Walking with Loads, Lifting)", [3.0, 310, 59, 68, 50, 59]), | |
| ("Heavy Work (Carrying Heavy Loads, Shoveling)", [4.0, 425, 73, 88, 73, 88]), | |
| ("Dancing (Moderate to Vigorous)", [3.5, 400, 59, 88, 59, 73]), | |
| ("Athletics/Exercise (Vigorous)", [6.0, 600, 88, 117, 88, 117]) | |
| ] | |
| } | |
| # Default building internals data as provided by user | |
| DEFAULT_BUILDING_INTERNALS = { | |
| name: { | |
| "lighting_density": data[0], # W/m² | |
| "diversity_factor": data[1], | |
| "equipment_heat_gains": { | |
| "sensible": data[2], | |
| "latent": data[3], | |
| "convective": data[4], | |
| "radiant": data[5] | |
| }, | |
| "ventilation_rate": data[6], # L/s·person or L/s·m² | |
| "air_change_rate": data[7], # ACH | |
| "schedule_type": data[8] | |
| } for name, data in [ | |
| ("Residential - Single-Family Detached", [8.0, 0.7, 3.5, 1.5, 2.0, 1.5, 7.5, 0.35, "residential"]), | |
| ("Residential - Single-Family Attached", [8.0, 0.7, 3.5, 1.5, 2.0, 1.5, 7.5, 0.35, "residential"]), | |
| ("Residential - Multifamily (Low-rise and High-rise)", [8.0, 0.75, 4.0, 2.0, 2.5, 1.5, 8.0, 0.35, "residential"]), | |
| ("Residential - Dormitories", [10.0, 0.8, 5.0, 2.0, 3.0, 2.0, 10.0, 0.5, "residential"]), | |
| ("Residential - Hotels and Motels", [12.0, 0.85, 6.0, 2.5, 3.5, 2.5, 10.0, 0.5, "hotel"]), | |
| ("Commercial/Retail - Strip Mall", [15.0, 0.9, 12.0, 2.0, 6.0, 6.0, 10.0, 1.0, "commercial"]), | |
| ("Commercial/Retail - Enclosed Mall", [18.0, 0.9, 15.0, 2.0, 8.0, 7.0, 10.0, 1.2, "commercial"]), | |
| ("Commercial/Retail - Department Store", [16.0, 0.9, 14.0, 2.0, 7.0, 7.0, 10.0, 1.0, "commercial"]), | |
| ("Commercial/Retail - Supermarket", [18.0, 0.95, 18.0, 3.0, 10.0, 8.0, 12.0, 1.2, "commercial"]), | |
| ("Commercial/Retail - Convenience Store", [20.0, 0.95, 20.0, 4.0, 12.0, 8.0, 12.0, 1.5, "commercial"]), | |
| ("Commercial/Retail - Fast Food Restaurant", [14.0, 0.85, 18.0, 6.0, 10.0, 8.0, 15.0, 1.5, "commercial"]), | |
| ("Commercial/Retail - Full-Service Restaurant", [14.0, 0.85, 16.0, 5.0, 9.0, 7.0, 15.0, 1.5, "commercial"]), | |
| ("Office - Small Office (<1,000 m²)", [12.0, 0.8, 10.0, 1.0, 5.0, 5.0, 10.0, 0.9, "office"]), | |
| ("Office - Medium Office (≈5,000 m²)", [12.0, 0.8, 10.0, 1.0, 5.0, 5.0, 10.0, 1.0, "office"]), | |
| ("Office - Large Office (>10,000 m²)", [12.0, 0.8, 10.0, 1.0, 5.0, 5.0, 10.0, 1.0, "office"]), | |
| ("Office - Call Centre", [13.0, 0.85, 12.0, 1.5, 6.0, 6.0, 12.0, 1.2, "office"]), | |
| ("Educational - Primary School", [14.0, 0.85, 6.0, 2.0, 3.0, 3.0, 10.0, 1.0, "school"]), | |
| ("Educational - Secondary School", [14.0, 0.85, 6.5, 2.0, 3.5, 3.0, 10.0, 1.0, "school"]), | |
| ("Educational - University/College Classroom", [14.0, 0.85, 7.0, 2.0, 4.0, 3.0, 10.0, 1.0, "school"]), | |
| ("Educational - Lecture Hall", [15.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "school"]), | |
| ("Educational - Laboratory", [16.0, 0.9, 20.0, 4.0, 12.0, 8.0, 15.0, 2.5, "school"]), | |
| ("Educational - Library", [13.0, 0.8, 5.0, 1.0, 2.5, 2.5, 8.0, 0.7, "school"]), | |
| ("Healthcare - Hospital (Inpatient)", [15.0, 0.95, 20.0, 5.0, 10.0, 10.0, 20.0, 2.0, "hospital"]), | |
| ("Healthcare - Outpatient Clinic/Medical Office", [14.0, 0.9, 15.0, 3.0, 8.0, 7.0, 15.0, 1.5, "hospital"]), | |
| ("Healthcare - Nursing Home/Aged Care", [13.0, 0.85, 10.0, 3.0, 5.0, 5.0, 12.0, 1.0, "hospital"]), | |
| ("Assembly - Auditorium", [12.0, 0.9, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "assembly"]), | |
| ("Assembly - Theatre/Performing Arts", [12.0, 0.9, 10.0, 2.0, 5.0, 5.0, 10.0, 1.0, "assembly"]), | |
| ("Assembly - Convention Centre", [14.0, 0.9, 12.0, 3.0, 6.0, 6.0, 12.0, 1.2, "assembly"]), | |
| ("Assembly - Gymnasium/Sports Arena", [15.0, 0.9, 14.0, 4.0, 8.0, 6.0, 12.0, 1.5, "assembly"]), | |
| ("Assembly - Religious Building", [12.0, 0.85, 6.0, 1.5, 3.0, 3.0, 10.0, 1.0, "assembly"]), | |
| ("Industrial - Light Manufacturing", [13.0, 0.9, 20.0, 2.0, 10.0, 10.0, 15.0, 1.5, "industrial"]), | |
| ("Industrial - Heavy Manufacturing", [13.0, 0.95, 30.0, 3.0, 15.0, 15.0, 20.0, 2.0, "industrial"]), | |
| ("Industrial - Warehouse (Unconditioned or Semi-conditioned)", [10.0, 0.7, 8.0, 1.0, 4.0, 4.0, 6.0, 0.5, "industrial"]), | |
| ("Industrial - Data Centre/Server Room", [15.0, 1.0, 80.0, 0.0, 80.0, 0.0, 20.0, 2.0, "industrial"]), | |
| ("Public and Institutional - Courthouse", [14.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "public_institutional"]), | |
| ("Public and Institutional - Police Station", [13.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "public_institutional"]), | |
| ("Public and Institutional - Fire Station", [13.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "public_institutional"]), | |
| ("Public and Institutional - Post Office", [14.0, 0.85, 10.0, 2.0, 5.0, 5.0, 10.0, 1.0, "public_institutional"]), | |
| ("Public and Institutional - Museum", [15.0, 0.9, 12.0, 2.0, 6.0, 6.0, 12.0, 1.2, "public_institutional"]), | |
| ("Lodging - Hotel (Full-Service, Midscale, or Economy)", [12.0, 0.85, 6.0, 2.0, 3.0, 3.0, 10.0, 0.8, "lodging"]), | |
| ("Lodging - Motel", [12.0, 0.85, 5.0, 2.0, 3.0, 2.0, 8.0, 0.8, "lodging"]), | |
| ("Lodging - Resort", [12.0, 0.85, 7.0, 2.5, 3.5, 3.5, 10.0, 0.8, "lodging"]), | |
| ("Transportation - Airport Terminal", [14.0, 0.95, 10.0, 3.0, 6.0, 4.0, 15.0, 1.5, "transport"]), | |
| ("Transportation - Train/Bus Station", [14.0, 0.9, 9.0, 2.0, 5.0, 4.0, 12.0, 1.2, "transport"]), | |
| ("Transportation - Car Park (Enclosed)", [8.0, 0.7, 2.0, 0.0, 2.0, 0.0, 5.0, 0.5, "transport"]), | |
| ("Other", [12.0, 0.85, 10.0, 2.0, 5.0, 5.0, 10.0, 1.0, "default"]) | |
| ] | |
| } | |
| DEFAULT_EQUIPMENT_LOADS = { | |
| name: { | |
| "equipment_load_w_m2": data[0], | |
| "sensible_percent": data[1], | |
| "latent_percent": data[2], | |
| "convective_percent": data[3], | |
| "radiant_percent": data[4] | |
| } for name, data in [ | |
| ("residential", [3.0, 90, 10, 65, 35]), | |
| ("office", [12.0, 100, 0, 75, 25]), | |
| ("commercial", [15.0, 95, 5, 70, 30]), | |
| ("educational", [10.0, 95, 5, 70, 30]), | |
| ("healthcare", [35.0, 80, 20, 65, 35]), | |
| ("assembly", [10.0, 95, 5, 65, 35]), | |
| ("industrial", [25.0, 85, 15, 75, 25]), | |
| ("public_institutional", [10.0, 90, 10, 75, 25]), | |
| ("lodging", [8.0, 85, 15, 65, 35]), | |
| ("transport", [10.0, 80, 20, 70, 30]), | |
| ("default", [10.0, 80, 20, 50, 50]) | |
| ] | |
| } | |
| DEFAULT_OCCUPANT_DENSITY = { | |
| name: { | |
| "occupant_densities_PEOPLE_m2": data[0] | |
| } for name, data in [ | |
| ("residential", [0.035]), | |
| ("office", [0.075]), | |
| ("commercial", [0.225]), | |
| ("educational", [0.15]), | |
| ("healthcare", [0.07]), | |
| ("assembly", [0.6]), | |
| ("industrial", [0.035]), | |
| ("public_institutional", [0.2]), | |
| ("lodging", [0.075]), | |
| ("transport", [0.3]), | |
| ("default", [0.05]) | |
| ] | |
| } | |
| # Default schedule templates | |
| DEFAULT_SCHEDULE_TEMPLATES = { | |
| "residential": { | |
| "description": "Typical residential usage (peaks morning and evening)", | |
| "weekday": [0.3, 0.3, 0.3, 0.3, 0.4, 0.5, 0.6, 0.7, 0.4, 0.3, 0.3, 0.4, | |
| 0.5, 0.5, 0.6, 0.8, 0.9, 1.0, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3], | |
| "weekend": [0.4, 0.4, 0.4, 0.4, 0.5, 0.6, 0.7, 0.9, 0.8, 0.7, 0.7, 0.6, | |
| 0.7, 0.8, 0.9, 1.0, 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.4] | |
| }, | |
| "office": { | |
| "description": "Standard office hours (8 AM - 6 PM)", | |
| "weekday": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.5, 1.0, 1.0, 1.0, 1.0, | |
| 0.8, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.3, 0.2, 0.1, 0.1, 0.1], | |
| "weekend": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, | |
| 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] | |
| }, | |
| "commercial": { | |
| "description": "Retail hours (9 AM - 9 PM)", | |
| "weekday": [0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.4, 0.7, 1.0, 1.0, 1.0, 1.0, | |
| 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.7, 0.5, 0.3, 0.2, 0.1, 0.1], | |
| "weekend": [0.1, 0.1, 0.1, 0.1, 0.2, 0.4, 0.7, 1.0, 1.0, 1.0, 1.0, 1.0, | |
| 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.1, 0.1] | |
| }, | |
| "educational": { | |
| "description": "School schedule (8 AM - 3 PM)", | |
| "weekday": [0.1, 0.1, 0.1, 0.1, 0.2, 0.5, 0.9, 1.0, 1.0, 1.0, 1.0, 1.0, | |
| 0.8, 0.7, 0.4, 0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], | |
| "weekend": [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, | |
| 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05] | |
| }, | |
| "healthcare": { | |
| "description": "24/7 full operation (hospitals)", | |
| "weekday": [1.0] * 24, | |
| "weekend": [1.0] * 24 | |
| }, | |
| "assembly": { | |
| "description": "Intermittent use with afternoon and evening peak", | |
| "weekday": [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.2, 0.3, 0.4, 0.5, | |
| 0.6, 0.8, 1.0, 1.0, 0.8, 0.5, 0.3, 0.2, 0.1, 0.1, 0.05, 0.05], | |
| "weekend": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.3, 0.5, 0.6, 0.7, | |
| 0.8, 1.0, 1.0, 1.0, 0.8, 0.5, 0.4, 0.3, 0.2, 0.1, 0.1, 0.1] | |
| }, | |
| "industrial": { | |
| "description": "Two shifts (6 AM - 10 PM)", | |
| "weekday": [0.1, 0.1, 0.1, 0.1, 0.1, 0.6, 0.8, 1.0, 1.0, 1.0, 1.0, 1.0, | |
| 1.0, 1.0, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0.1, 0.1, 0.1], | |
| "weekend": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, | |
| 0.4, 0.4, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2] | |
| }, | |
| "public_institutional": { | |
| "description": "Standard institutional hours (8 AM - 6 PM)", | |
| "weekday": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.5, 0.8, 1.0, 1.0, 1.0, 1.0, | |
| 0.8, 0.7, 0.5, 0.3, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], | |
| "weekend": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, | |
| 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] | |
| }, | |
| "lodging": { | |
| "description": "Lodging facilities (moderate usage all day)", | |
| "weekday": [0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, | |
| 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9], | |
| "weekend": [0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, | |
| 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] | |
| }, | |
| "transport": { | |
| "description": "Transport hubs (early start, taper late night)", | |
| "weekday": [0.3, 0.4, 0.6, 0.8, 1.0, 1.0, 0.9, 0.9, 0.8, 0.7, 0.6, 0.6, | |
| 0.5, 0.5, 0.6, 0.7, 0.8, 1.0, 0.8, 0.6, 0.5, 0.4, 0.3, 0.2], | |
| "weekend": [0.2, 0.3, 0.4, 0.6, 0.8, 0.8, 0.7, 0.7, 0.6, 0.6, 0.5, 0.5, | |
| 0.6, 0.7, 0.8, 0.9, 0.9, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1] | |
| }, | |
| "continuous": { | |
| "description": "Continuous operation 24/7 (e.g., data centre)", | |
| "weekday": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, | |
| 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], | |
| "weekend": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, | |
| 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] | |
| }, | |
| "default": { | |
| "description": "Custom schedule – user-defined", | |
| "weekday": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.5, 1.0, 1.0, 1.0, 1.0, | |
| 0.8, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.3, 0.2, 0.1, 0.1, 0.1], | |
| "weekend": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, | |
| 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] | |
| } | |
| } | |
| # Lighting Fixture Types and Heat Gain Splits | |
| LIGHTING_FIXTURE_TYPES = { | |
| "Incandescent": {"radiative": 80, "convective": 20}, | |
| "Fluorescent": {"radiative": 60, "convective": 40}, | |
| "Compact Fluorescent (CFL)": {"radiative": 60, "convective": 40}, | |
| "LED (Light Emitting Diode)": {"radiative": 50, "convective": 50}, | |
| "High-Intensity Discharge (HID)": {"radiative": 70, "convective": 30}, | |
| "Halogen": {"radiative": 80, "convective": 20} | |
| } | |
| def display_internal_loads_help(): | |
| """Display help information for the internal loads page.""" | |
| st.markdown(""" | |
| ### Internal Loads Help | |
| This page allows you to define internal heat gains from various sources within the building. | |
| #### People | |
| - Define occupancy groups with different activity levels | |
| - Activity levels determine metabolic heat generation | |
| - Clothing insulation affects comfort calculations | |
| - Schedules control when people are present | |
| #### Lighting | |
| - Define lighting systems with power density | |
| - Heat distribution between radiative and convective components | |
| - Schedules control lighting operation | |
| #### Equipment | |
| - Define equipment heat gains (computers, appliances, etc.) | |
| - Separate sensible and latent heat gains | |
| - Heat distribution between radiative and convective components | |
| #### Ventilation & Infiltration | |
| - **Ventilation**: Controlled outdoor air introduction | |
| - **Infiltration**: Uncontrolled air leakage | |
| - Rates based on building type and design standards | |
| #### Schedules | |
| - Define hourly operation profiles (0.0 = off, 1.0 = full operation) | |
| - Separate weekday and weekend schedules | |
| - Templates available for common building types | |
| - Custom schedules can be created for specific needs | |
| #### Usage Tips | |
| 1. Start with building type defaults and adjust as needed | |
| 2. Create realistic schedules based on actual building operation | |
| 3. Consider diversity factors for large buildings | |
| 4. Validate total loads against design expectations | |
| """) | |
| # |