mabuseif commited on
Commit
d5ae9f0
·
verified ·
1 Parent(s): 4867418

Update app/i_l_data.py

Browse files
Files changed (1) hide show
  1. app/i_l_data.py +207 -0
app/i_l_data.py CHANGED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # People activity levels data as provided by user
2
+ PEOPLE_ACTIVITY_LEVELS = {
3
+ name: {
4
+ "metabolic_rate_met": data[0],
5
+ "metabolic_rate_w": data[1],
6
+ "sensible_min_w": data[2],
7
+ "sensible_max_w": data[3],
8
+ "latent_min_w": data[4],
9
+ "latent_max_w": data[5]
10
+ } for name, data in [
11
+ ("Seated, at Rest (Quiet, Reading, Writing)", [1.0, 110, 20, 24, 9, 12]),
12
+ ("Seated, Light Office Work (Typing, Filing)", [1.1, 125, 24, 27, 12, 15]),
13
+ ("Standing, Light Work (Filing, Walking Slowly)", [1.35, 155, 30, 35, 18, 24]),
14
+ ("Walking, Moderate Pace (2–3 mph / 3.2–4.8 km/h)", [2.0, 210, 41, 47, 30, 35]),
15
+ ("Light Machine Work (Assembly, Small Tools)", [2.35, 250, 47, 56, 35, 44]),
16
+ ("Moderate Work (Walking with Loads, Lifting)", [3.0, 310, 59, 68, 50, 59]),
17
+ ("Heavy Work (Carrying Heavy Loads, Shoveling)", [4.0, 425, 73, 88, 73, 88]),
18
+ ("Dancing (Moderate to Vigorous)", [3.5, 400, 59, 88, 59, 73]),
19
+ ("Athletics/Exercise (Vigorous)", [6.0, 600, 88, 117, 88, 117])
20
+ ]
21
+ }
22
+
23
+ # Default building internals data as provided by user
24
+ DEFAULT_BUILDING_INTERNALS = {
25
+ name: {
26
+ "lighting_density": data[0], # W/m²
27
+ "diversity_factor": data[1],
28
+ "equipment_heat_gains": {
29
+ "sensible": data[2],
30
+ "latent": data[3],
31
+ "convective": data[4],
32
+ "radiant": data[5]
33
+ },
34
+ "ventilation_rate": data[6], # L/s·person or L/s·m²
35
+ "air_change_rate": data[7], # ACH
36
+ "schedule_type": data[8]
37
+ } for name, data in [
38
+ ("Residential - Single-Family Detached", [8.0, 0.7, 3.5, 1.5, 2.0, 1.5, 7.5, 0.35, "residential"]),
39
+ ("Residential - Single-Family Attached", [8.0, 0.7, 3.5, 1.5, 2.0, 1.5, 7.5, 0.35, "residential"]),
40
+ ("Residential - Multifamily (Low-rise and High-rise)", [8.0, 0.75, 4.0, 2.0, 2.5, 1.5, 8.0, 0.35, "residential"]),
41
+ ("Residential - Dormitories", [10.0, 0.8, 5.0, 2.0, 3.0, 2.0, 10.0, 0.5, "residential"]),
42
+ ("Residential - Hotels and Motels", [12.0, 0.85, 6.0, 2.5, 3.5, 2.5, 10.0, 0.5, "hotel"]),
43
+ ("Commercial/Retail - Strip Mall", [15.0, 0.9, 12.0, 2.0, 6.0, 6.0, 10.0, 1.0, "retail"]),
44
+ ("Commercial/Retail - Enclosed Mall", [18.0, 0.9, 15.0, 2.0, 8.0, 7.0, 10.0, 1.2, "retail"]),
45
+ ("Commercial/Retail - Department Store", [16.0, 0.9, 14.0, 2.0, 7.0, 7.0, 10.0, 1.0, "retail"]),
46
+ ("Commercial/Retail - Supermarket", [18.0, 0.95, 18.0, 3.0, 10.0, 8.0, 12.0, 1.2, "retail"]),
47
+ ("Commercial/Retail - Convenience Store", [20.0, 0.95, 20.0, 4.0, 12.0, 8.0, 12.0, 1.5, "retail"]),
48
+ ("Commercial/Retail - Fast Food Restaurant", [14.0, 0.85, 18.0, 6.0, 10.0, 8.0, 15.0, 1.5, "retail"]),
49
+ ("Commercial/Retail - Full-Service Restaurant", [14.0, 0.85, 16.0, 5.0, 9.0, 7.0, 15.0, 1.5, "retail"]),
50
+ ("Office - Small Office (<1,000 m²)", [12.0, 0.8, 10.0, 1.0, 5.0, 5.0, 10.0, 0.9, "office"]),
51
+ ("Office - Medium Office (≈5,000 m²)", [12.0, 0.8, 10.0, 1.0, 5.0, 5.0, 10.0, 1.0, "office"]),
52
+ ("Office - Large Office (>10,000 m²)", [12.0, 0.8, 10.0, 1.0, 5.0, 5.0, 10.0, 1.0, "office"]),
53
+ ("Office - Call Centre", [13.0, 0.85, 12.0, 1.5, 6.0, 6.0, 12.0, 1.2, "office"]),
54
+ ("Educational - Primary School", [14.0, 0.85, 6.0, 2.0, 3.0, 3.0, 10.0, 1.0, "school"]),
55
+ ("Educational - Secondary School", [14.0, 0.85, 6.5, 2.0, 3.5, 3.0, 10.0, 1.0, "school"]),
56
+ ("Educational - University/College Classroom", [14.0, 0.85, 7.0, 2.0, 4.0, 3.0, 10.0, 1.0, "school"]),
57
+ ("Educational - Lecture Hall", [15.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "school"]),
58
+ ("Educational - Laboratory", [16.0, 0.9, 20.0, 4.0, 12.0, 8.0, 15.0, 2.5, "school"]),
59
+ ("Educational - Library", [13.0, 0.8, 5.0, 1.0, 2.5, 2.5, 8.0, 0.7, "school"]),
60
+ ("Healthcare - Hospital (Inpatient)", [15.0, 0.95, 20.0, 5.0, 10.0, 10.0, 20.0, 2.0, "hospital"]),
61
+ ("Healthcare - Outpatient Clinic/Medical Office", [14.0, 0.9, 15.0, 3.0, 8.0, 7.0, 15.0, 1.5, "hospital"]),
62
+ ("Healthcare - Nursing Home/Aged Care", [13.0, 0.85, 10.0, 3.0, 5.0, 5.0, 12.0, 1.0, "hospital"]),
63
+ ("Assembly - Auditorium", [12.0, 0.9, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "assembly"]),
64
+ ("Assembly - Theatre/Performing Arts", [12.0, 0.9, 10.0, 2.0, 5.0, 5.0, 10.0, 1.0, "assembly"]),
65
+ ("Assembly - Convention Centre", [14.0, 0.9, 12.0, 3.0, 6.0, 6.0, 12.0, 1.2, "assembly"]),
66
+ ("Assembly - Gymnasium/Sports Arena", [15.0, 0.9, 14.0, 4.0, 8.0, 6.0, 12.0, 1.5, "assembly"]),
67
+ ("Assembly - Religious Building", [12.0, 0.85, 6.0, 1.5, 3.0, 3.0, 10.0, 1.0, "assembly"]),
68
+ ("Industrial - Light Manufacturing", [13.0, 0.9, 20.0, 2.0, 10.0, 10.0, 15.0, 1.5, "industrial"]),
69
+ ("Industrial - Heavy Manufacturing", [13.0, 0.95, 30.0, 3.0, 15.0, 15.0, 20.0, 2.0, "industrial"]),
70
+ ("Industrial - Warehouse (Unconditioned or Semi-conditioned)", [10.0, 0.7, 8.0, 1.0, 4.0, 4.0, 6.0, 0.5, "industrial"]),
71
+ ("Industrial - Data Centre/Server Room", [15.0, 1.0, 80.0, 0.0, 80.0, 0.0, 20.0, 2.0, "industrial"]),
72
+ ("Public and Institutional - Courthouse", [14.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "office"]),
73
+ ("Public and Institutional - Police Station", [13.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "office"]),
74
+ ("Public and Institutional - Fire Station", [13.0, 0.85, 8.0, 2.0, 4.0, 4.0, 10.0, 1.0, "office"]),
75
+ ("Public and Institutional - Post Office", [14.0, 0.85, 10.0, 2.0, 5.0, 5.0, 10.0, 1.0, "office"]),
76
+ ("Public and Institutional - Museum", [15.0, 0.9, 12.0, 2.0, 6.0, 6.0, 12.0, 1.2, "office"]),
77
+ ("Lodging - Hotel (Full-Service, Midscale, or Economy)", [12.0, 0.85, 6.0, 2.0, 3.0, 3.0, 10.0, 0.8, "hotel"]),
78
+ ("Lodging - Motel", [12.0, 0.85, 5.0, 2.0, 3.0, 2.0, 8.0, 0.8, "hotel"]),
79
+ ("Lodging - Resort", [12.0, 0.85, 7.0, 2.5, 3.5, 3.5, 10.0, 0.8, "hotel"]),
80
+ ("Transportation - Airport Terminal", [14.0, 0.95, 10.0, 3.0, 6.0, 4.0, 15.0, 1.5, "transport"]),
81
+ ("Transportation - Train/Bus Station", [14.0, 0.9, 9.0, 2.0, 5.0, 4.0, 12.0, 1.2, "transport"]),
82
+ ("Transportation - Car Park (Enclosed)", [8.0, 0.7, 2.0, 0.0, 2.0, 0.0, 5.0, 0.5, "transport"]),
83
+ ("Other", [12.0, 0.85, 10.0, 2.0, 5.0, 5.0, 10.0, 1.0, "default"]),
84
+ ("Continuous", [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, "continuous"]),
85
+ ("Custom", [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, "custom"])
86
+ ]
87
+ }
88
+
89
+
90
+ # Default schedule templates
91
+ DEFAULT_SCHEDULE_TEMPLATES = {
92
+ "residential": {
93
+ "description": "Typical residential usage (peaks morning and evening)",
94
+ "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,
95
+ 0.5, 0.5, 0.6, 0.8, 0.9, 1.0, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3],
96
+ "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,
97
+ 0.7, 0.8, 0.9, 1.0, 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.4]
98
+ },
99
+ "office": {
100
+ "description": "Standard office hours (8 AM - 6 PM)",
101
+ "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,
102
+ 0.8, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.3, 0.2, 0.1, 0.1, 0.1],
103
+ "weekend": [0.1] * 24
104
+ },
105
+ "commercial": {
106
+ "description": "Retail hours (9 AM - 9 PM)",
107
+ "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,
108
+ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.7, 0.5, 0.3, 0.2, 0.1, 0.1],
109
+ "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,
110
+ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.1, 0.1]
111
+ },
112
+ "educational": {
113
+ "description": "School schedule (8 AM - 3 PM)",
114
+ "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,
115
+ 0.8, 0.7, 0.4, 0.2, 0.1] + [0.1]*7,
116
+ "weekend": [0.05] * 24
117
+ },
118
+ "healthcare": {
119
+ "description": "24/7 full operation (hospitals)",
120
+ "weekday": [1.0] * 24,
121
+ "weekend": [1.0] * 24
122
+ },
123
+ "assembly": {
124
+ "description": "Intermittent use with afternoon and evening peak",
125
+ "weekday": [0.05]*8 + [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],
126
+ "weekend": [0.1]*8 + [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]
127
+ },
128
+ "industrial": {
129
+ "description": "Two shifts (6 AM - 10 PM)",
130
+ "weekday": [0.1]*5 + [0.6, 0.8, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
131
+ 1.0, 1.0, 0.8, 0.6] + [0.4, 0.3, 0.2, 0.1, 0.1],
132
+ "weekend": [0.1]*6 + [0.4]*8 + [0.2]*10
133
+ },
134
+ "public_institutional": {
135
+ "description": "Standard institutional hours (8 AM - 6 PM)",
136
+ "weekday": [0.1]*6 + [0.5, 0.8, 1.0, 1.0, 1.0, 1.0, 0.8, 0.7,
137
+ 0.5, 0.3] + [0.2]*8,
138
+ "weekend": [0.1]*24
139
+ },
140
+ "lodging": {
141
+ "description": "Lodging facilities (moderate usage all day)",
142
+ "weekday": [0.6]*6 + [0.7]*6 + [0.8]*6 + [0.9]*6,
143
+ "weekend": [0.7]*6 + [0.8]*6 + [0.9]*6 + [1.0]*6
144
+ },
145
+ "transport": {
146
+ "description": "Transport hubs (early start, taper late night)",
147
+ "weekday": [0.3, 0.4, 0.6, 0.8, 1.0, 1.0, 0.9, 0.9, 0.8, 0.7,
148
+ 0.6, 0.6, 0.5, 0.5, 0.6, 0.7, 0.8, 1.0, 0.8, 0.6,
149
+ 0.5, 0.4, 0.3, 0.2],
150
+ "weekend": [0.2, 0.3, 0.4, 0.6, 0.8, 0.8, 0.7, 0.7, 0.6, 0.6,
151
+ 0.5, 0.5, 0.6, 0.7, 0.8, 0.9, 0.9, 1.0, 0.8, 0.6,
152
+ 0.4, 0.3, 0.2, 0.1]
153
+ },
154
+ "continuous": {
155
+ "description": "Continuous operation 24/7 (e.g., data centre)",
156
+ "weekday": [1.0] * 24,
157
+ "weekend": [1.0] * 24
158
+ },
159
+ "custom": {
160
+ "description": "Custom schedule – user-defined",
161
+ "weekday": [0.0] * 24,
162
+ "weekend": [0.0] * 24
163
+ }
164
+ }
165
+
166
+ def display_internal_loads_help():
167
+ """Display help information for the internal loads page."""
168
+ st.markdown("""
169
+ ### Internal Loads Help
170
+
171
+ This page allows you to define internal heat gains from various sources within the building.
172
+
173
+ #### People
174
+ - Define occupancy groups with different activity levels
175
+ - Activity levels determine metabolic heat generation
176
+ - Clothing insulation affects comfort calculations
177
+ - Schedules control when people are present
178
+
179
+ #### Lighting
180
+ - Define lighting systems with power density
181
+ - Heat distribution between radiative and convective components
182
+ - Schedules control lighting operation
183
+
184
+ #### Equipment
185
+ - Define equipment heat gains (computers, appliances, etc.)
186
+ - Separate sensible and latent heat gains
187
+ - Heat distribution between radiative and convective components
188
+
189
+ #### Ventilation & Infiltration
190
+ - **Ventilation**: Controlled outdoor air introduction
191
+ - **Infiltration**: Uncontrolled air leakage
192
+ - Rates based on building type and design standards
193
+
194
+ #### Schedules
195
+ - Define hourly operation profiles (0.0 = off, 1.0 = full operation)
196
+ - Separate weekday and weekend schedules
197
+ - Templates available for common building types
198
+ - Custom schedules can be created for specific needs
199
+
200
+ #### Usage Tips
201
+ 1. Start with building type defaults and adjust as needed
202
+ 2. Create realistic schedules based on actual building operation
203
+ 3. Consider diversity factors for large buildings
204
+ 4. Validate total loads against design expectations
205
+ """)
206
+
207
+ #