mabuseif commited on
Commit
7f43faa
verified
1 Parent(s): ccb108e

Update data/material_library.py

Browse files
Files changed (1) hide show
  1. data/material_library.py +222 -54
data/material_library.py CHANGED
@@ -2,6 +2,7 @@
2
  Material Library for HVAC Load Calculator
3
  Updated 2025-05-17: Removed original materials and constructions, deleted ASHRAE materials starting with 'R' followed by number (e.g., R01, R25), verified constructions use valid materials.
4
  Updated 2025-05-17: Added all materials and constructions from ASHRAE_2005_HOF_Materials.idf with Australian-specific embodied carbon and prices.
 
5
  Updated 2025-05-16: Removed mass_per_meter, added thermal_mass method, updated CSV handling.
6
  Updated 2025-05-16: Fixed U-value calculation in Material.get_u_value.
7
  Updated 2025-05-16: Updated MaterialCategory to Finishing Materials, Structural Materials, Sub-Structural Materials, Insulation.
@@ -55,6 +56,24 @@ class Material:
55
  def get_u_value(self) -> float:
56
  return self.conductivity / self.default_thickness if self.default_thickness > 0 else 0.1
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  class Construction:
59
  def __init__(self, name: str, component_type: str, layers: List[Dict], is_library: bool = True):
60
  self.name = name
@@ -96,69 +115,106 @@ class MaterialLibrary:
96
  def __init__(self):
97
  self.library_materials = self.initialize_materials()
98
  self.library_constructions = self.initialize_constructions()
 
 
99
 
100
  def initialize_materials(self) -> Dict[str, Material]:
101
  materials = [
102
  # ASHRAE 2005 HOF Materials (excluding 'R'-prefixed materials)
103
- Material("F04 Wall air space resistance", MaterialCategory.INSULATION, 0.01, 1.0, 1000.0, 0.01, 0.01, 0.5, 0.5), # Price: 1 * 0.01 * $0.5
104
- Material("F05 Ceiling air space resistance", MaterialCategory.INSULATION, 0.01, 1.0, 1000.0, 0.01, 0.01, 0.5, 0.5), # Price: 1 * 0.01 * $0.5
105
- Material("F06 EIFS finish", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0095, 0.3, 0.5, 17.6), # Price: 1856 * 0.0095 * $1
106
- Material("F07 25mm stucco", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0254, 0.2, 0.6, 14.1), # Price: 1856 * 0.0254 * $0.3
107
- Material("F08 Metal surface", MaterialCategory.SUB_STRUCTURAL_MATERIALS, 45.28, 7824.0, 500.0, 0.0008, 2.2, 0.7, 25.0), # Price: 7824 * 0.0008 * $4
108
- Material("F09 25mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0254, 0.2, 0.6, 14.1), # Price: 1856 * 0.0254 * $0.3
109
- Material("F10 13mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0127, 0.25, 0.4, 5.1), # Price: 800 * 0.0127 * $0.5
110
- Material("F11 16mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0159, 0.25, 0.4, 6.4), # Price: 800 * 0.0159 * $0.5
111
- Material("F12 19mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0191, 0.25, 0.4, 7.6), # Price: 800 * 0.0191 * $0.5
112
- Material("F13 13mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0127, 0.2, 0.6, 7.1), # Price: 1856 * 0.0127 * $0.3
113
- Material("F14 13mm lime plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1600.0, 840.0, 0.0127, 0.2, 0.5, 6.1), # Price: 1600 * 0.0127 * $0.3
114
- Material("F15 22mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0222, 0.2, 0.6, 12.4), # Price: 1856 * 0.0222 * $0.3
115
- Material("F16 Acoustic tile", MaterialCategory.FINISHING_MATERIALS, 0.06, 368.0, 590.0, 0.0191, 1.0, 0.4, 14.0), # Price: 368 * 0.0191 * $2
116
- Material("F17 13mm slag", MaterialCategory.FINISHING_MATERIALS, 0.16, 960.0, 1090.0, 0.0127, 0.2, 0.5, 1.0), # Price: 960 * 0.0127 * $0.08
117
- Material("F18 25mm slag", MaterialCategory.FINISHING_MATERIALS, 0.16, 960.0, 1090.0, 0.0254, 0.2, 0.5, 1.9), # Price: 960 * 0.0254 * $0.08
118
- Material("G01 13mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0127, 0.25, 0.4, 5.1), # Price: 800 * 0.0127 * $0.5
119
- Material("G01a 19mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0191, 0.25, 0.4, 7.6), # Price: 800 * 0.0191 * $0.5
120
- Material("G02 25mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0254, 0.2, 0.6, 14.1), # Price: 1856 * 0.0254 * $0.3
121
- Material("G03 13mm lime plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1600.0, 840.0, 0.0127, 0.25, 0.5, 6.1), # Price: 1600 * 0.0127 * $0.3
122
- Material("G04 13mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0127, 0.2, 0.6, 7.1), # Price: 1856 * 0.0127 * $0.3
123
- Material("G05 25mm wood", MaterialCategory.SUB_STRUCTURAL_MATERIALS, 0.15, 608.0, 1630.0, 0.0254, 0.3, 0.5, 15.4), # Price: 608 * 0.0254 * $1
124
- Material("G06 19mm wood", MaterialCategory.SUB_STRUCTURAL_MATERIALS, 0.15, 608.0, 1630.0, 0.0191, 0.3, 0.5, 11.6), # Price: 608 * 0.0191 * $1
125
- Material("I01 25mm insulation board", MaterialCategory.INSULATION, 0.03, 43.0, 1210.0, 0.0254, 2.5, 0.5, 1.1), # Price: 43 * 0.0254 * $1
126
- Material("I02 50mm insulation board", MaterialCategory.INSULATION, 0.03, 43.0, 1210.0, 0.0508, 2.5, 0.5, 2.2), # Price: 43 * 0.0508 * $1
127
- Material("I03 75mm insulation board", MaterialCategory.INSULATION, 0.03, 43.0, 1210.0, 0.0762, 2.5, 0.5, 3.3), # Price: 43 * 0.0762 * $1
128
- Material("M01 100mm brick", MaterialCategory.STRUCTURAL_MATERIALS, 0.89, 1920.0, 790.0, 0.1016, 0.3, 0.7, 19.5), # Price: 1920 * 0.1016 * $0.1
129
- Material("M02 100mm face brick", MaterialCategory.STRUCTURAL_MATERIALS, 1.33, 2000.0, 790.0, 0.1016, 0.3, 0.7, 20.3), # Price: 2000 * 0.1016 * $0.1
130
- Material("M03 150mm brick", MaterialCategory.STRUCTURAL_MATERIALS, 0.89, 1920.0, 790.0, 0.1524, 0.3, 0.7, 29.3), # Price: 1920 * 0.1524 * $0.1
131
- Material("M04 200mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 0.51, 800.0, 920.0, 0.2032, 0.2, 0.65, 13.0), # Price: 800 * 0.2032 * $0.08
132
- Material("M05 200mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 1.11, 1280.0, 920.0, 0.2032, 0.2, 0.65, 20.8), # Price: 1280 * 0.2032 * $0.08
133
- Material("M06 150mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 0.51, 800.0, 920.0, 0.1524, 0.2, 0.65, 9.8), # Price: 800 * 0.1524 * $0.08
134
- Material("M07 100mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 0.51, 800.0, 920.0, 0.1016, 0.2, 0.65, 6.5), # Price: 800 * 0.1016 * $0.08
135
- Material("M08 150mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 1.11, 1280.0, 920.0, 0.1524, 0.2, 0.65, 15.6), # Price: 1280 * 0.1524 * $0.08
136
- Material("M09 100mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 1.11, 1280.0, 920.0, 0.1016, 0.2, 0.65, 10.4), # Price: 1280 * 0.1016 * $0.08
137
- Material("M10 100mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.1016, 0.15, 0.65, 7.8), # Price: 1280 * 0.1016 * $0.06
138
- Material("M11 100mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.1016, 0.15, 0.65, 7.8), # Price: 1280 * 0.1016 * $0.06
139
- Material("M12 150mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.1524, 0.15, 0.65, 11.7), # Price: 1280 * 0.1524 * $0.06
140
- Material("M13 200mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.2032, 0.15, 0.65, 15.6), # Price: 1280 * 0.2032 * $0.06
141
- Material("M14 100mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.1016, 0.2, 0.65, 18.2), # Price: 2240 * 0.1016 * $0.08
142
- Material("M14a 100mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.1016, 0.2, 0.65, 18.2), # Price: 2240 * 0.1016 * $0.08
143
- Material("M15 200mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.2032, 0.2, 0.65, 36.4), # Price: 2240 * 0.2032 * $0.08
144
- Material("M16 300mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.3048, 0.2, 0.65, 54.6), # Price: 2240 * 0.3048 * $0.08
145
- Material("M17 100mm stone", MaterialCategory.STRUCTURAL_MATERIALS, 2.10, 2240.0, 880.0, 0.1016, 0.2, 0.7, 22.8), # Price: 2240 * 0.1016 * $0.1
146
- Material("M18 150mm stone", MaterialCategory.STRUCTURAL_MATERIALS, 2.10, 2240.0, 880.0, 0.1524, 0.2, 0.7, 34.1), # Price: 2240 * 0.1524 * $0.1
147
- Material("M19 100mm limestone", MaterialCategory.STRUCTURAL_MATERIALS, 1.80, 2320.0, 880.0, 0.1016, 0.2, 0.6, 23.6), # Price: 2320 * 0.1016 * $0.1
148
- Material("M20 150mm limestone", MaterialCategory.STRUCTURAL_MATERIALS, 1.80, 2320.0, 880.0, 0.1524, 0.2, 0.6, 35.4), # Price: 2320 * 0.1524 * $0.1
149
- Material("M21 200mm limestone", MaterialCategory.STRUCTURAL_MATERIALS, 1.80, 2320.0, 880.0, 0.2032, 0.2, 0.6, 47.1), # Price: 2320 * 0.2032 * $0.1
150
- Material("M22 100mm granite", MaterialCategory.STRUCTURAL_MATERIALS, 2.80, 2640.0, 880.0, 0.1016, 0.2, 0.7, 26.8), # Price: 2640 * 0.1016 * $0.1
151
- Material("M23 150mm granite", MaterialCategory.STRUCTURAL_MATERIALS, 2.80, 2640.0, 880.0, 0.1524, 0.2, 0.7, 40.2), # Price: 2640 * 0.1524 * $0.1
152
- Material("M24 200mm granite", MaterialCategory.STRUCTURAL_MATERIALS, 2.80, 2640.0, 880.0, 0.2032, 0.2, 0.7, 53.6), # Price: 2640 * 0.2032 * $0.1
153
- Material("M25 100mm marble", MaterialCategory.STRUCTURAL_MATERIALS, 2.50, 2720.0, 880.0, 0.1016, 0.2, 0.6, 27.6), # Price: 2720 * 0.1016 * $0.1
154
- Material("M26 150mm marble", MaterialCategory.STRUCTURAL_MATERIALS, 2.50, 2720.0, 880.0, 0.1524, 0.2, 0.6, 41.4), # Price: 2720 * 0.1524 * $0.1
155
- Material("M27 200mm marble", MaterialCategory.STRUCTURAL_MATERIALS, 2.50, 2720.0, 880.0, 0.2032, 0.2, 0.6, 55.3), # Price: 2720 * 0.2032 * $0.1
156
  ]
157
  return {mat.name: mat for mat in materials}
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  def initialize_constructions(self) -> Dict[str, Construction]:
160
  constructions = [
161
- # ASHRAE 2005 HOF Constructions
162
  Construction("Light Exterior Wall", "Wall", [
163
  {"material": self.library_materials["F08 Metal surface"], "thickness": 0.0008},
164
  {"material": self.library_materials["I02 50mm insulation board"], "thickness": 0.0508},
@@ -241,6 +297,18 @@ class MaterialLibrary:
241
  materials.extend(list(project_materials.values()))
242
  return materials
243
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  def add_project_material(self, material: Material, project_materials: Dict[str, Material]) -> Tuple[bool, str]:
245
  if len(project_materials) >= 20:
246
  return False, "Maximum 20 project materials allowed."
@@ -249,6 +317,22 @@ class MaterialLibrary:
249
  project_materials[material.name] = material
250
  return True, f"Material '{material.name}' added to project materials."
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  def edit_project_material(self, old_name: str, new_material: Material, project_materials: Dict[str, Material],
253
  components: Dict[str, List]) -> Tuple[bool, str]:
254
  if old_name not in project_materials:
@@ -270,6 +354,40 @@ class MaterialLibrary:
270
  project_materials[new_material.name] = new_material
271
  return True, f"Material '{old_name}' updated to '{new_material.name}'."
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  def delete_project_material(self, name: str, project_materials: Dict[str, Material], components: Dict[str, List]) -> Tuple[bool, str]:
274
  if name not in project_materials:
275
  return False, f"Material '{name}' not found in project materials."
@@ -283,6 +401,28 @@ class MaterialLibrary:
283
  del project_materials[name]
284
  return True, f"Material '{name}' deleted successfully."
285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  def add_project_construction(self, construction: Construction, project_constructions: Dict[str, Construction]) -> Tuple[bool, str]:
287
  if len(project_constructions) >= 20:
288
  return False, "Maximum 20 project constructions allowed."
@@ -321,6 +461,8 @@ class MaterialLibrary:
321
 
322
  def to_dataframe(self, data_type: str, project_materials: Optional[Dict[str, Material]] = None,
323
  project_constructions: Optional[Dict[str, Construction]] = None,
 
 
324
  only_project: bool = False) -> pd.DataFrame:
325
  if data_type == "materials":
326
  data = []
@@ -358,4 +500,30 @@ class MaterialLibrary:
358
  "Source": "Project" if not cons.is_library else "Library"
359
  })
360
  return pd.DataFrame(data)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  return pd.DataFrame()
 
2
  Material Library for HVAC Load Calculator
3
  Updated 2025-05-17: Removed original materials and constructions, deleted ASHRAE materials starting with 'R' followed by number (e.g., R01, R25), verified constructions use valid materials.
4
  Updated 2025-05-17: Added all materials and constructions from ASHRAE_2005_HOF_Materials.idf with Australian-specific embodied carbon and prices.
5
+ Updated 2025-05-17: Added GlazingMaterial and DoorMaterial classes, included library_glazing_materials and library_door_materials with comprehensive data.
6
  Updated 2025-05-16: Removed mass_per_meter, added thermal_mass method, updated CSV handling.
7
  Updated 2025-05-16: Fixed U-value calculation in Material.get_u_value.
8
  Updated 2025-05-16: Updated MaterialCategory to Finishing Materials, Structural Materials, Sub-Structural Materials, Insulation.
 
56
  def get_u_value(self) -> float:
57
  return self.conductivity / self.default_thickness if self.default_thickness > 0 else 0.1
58
 
59
+ class GlazingMaterial:
60
+ def __init__(self, name: str, u_value: float, shgc: float, embodied_carbon: float, price: float, is_library: bool = True):
61
+ self.name = name
62
+ self.u_value = max(0.1, u_value) # W/m虏路K
63
+ self.shgc = min(max(0.0, shgc), 1.0) # Solar Heat Gain Coefficient
64
+ self.embodied_carbon = max(0.0, embodied_carbon) # kgCO鈧俥/m虏
65
+ self.price = max(0.0, price) # USD/m虏
66
+ self.is_library = is_library
67
+
68
+ class DoorMaterial:
69
+ def __init__(self, name: str, u_value: float, solar_absorption: float, embodied_carbon: float, price: float, is_library: bool = True):
70
+ self.name = name
71
+ self.u_value = max(0.1, u_value) # W/m虏路K
72
+ self.solar_absorption = min(max(0.0, solar_absorption), 1.0)
73
+ self.embodied_carbon = max(0.0, embodied_carbon) # kgCO鈧俥/m虏
74
+ self.price = max(0.0, price) # USD/m虏
75
+ self.is_library = is_library
76
+
77
  class Construction:
78
  def __init__(self, name: str, component_type: str, layers: List[Dict], is_library: bool = True):
79
  self.name = name
 
115
  def __init__(self):
116
  self.library_materials = self.initialize_materials()
117
  self.library_constructions = self.initialize_constructions()
118
+ self.library_glazing_materials = self.initialize_glazing_materials()
119
+ self.library_door_materials = self.initialize_door_materials()
120
 
121
  def initialize_materials(self) -> Dict[str, Material]:
122
  materials = [
123
  # ASHRAE 2005 HOF Materials (excluding 'R'-prefixed materials)
124
+ Material("F04 Wall air space resistance", MaterialCategory.INSULATION, 0.01, 1.0, 1000.0, 0.01, 0.01, 0.5, 0.5),
125
+ Material("F05 Ceiling air space resistance", MaterialCategory.INSULATION, 0.01, 1.0, 1000.0, 0.01, 0.01, 0.5, 0.5),
126
+ Material("F06 EIFS finish", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0095, 0.3, 0.5, 17.6),
127
+ Material("F07 25mm stucco", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0254, 0.2, 0.6, 14.1),
128
+ Material("F08 Metal surface", MaterialCategory.SUB_STRUCTURAL_MATERIALS, 45.28, 7824.0, 500.0, 0.0008, 2.2, 0.7, 25.0),
129
+ Material("F09 25mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0254, 0.2, 0.6, 14.1),
130
+ Material("F10 13mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0127, 0.25, 0.4, 5.1),
131
+ Material("F11 16mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0159, 0.25, 0.4, 6.4),
132
+ Material("F12 19mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0191, 0.25, 0.4, 7.6),
133
+ Material("F13 13mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0127, 0.2, 0.6, 7.1),
134
+ Material("F14 13mm lime plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1600.0, 840.0, 0.0127, 0.2, 0.5, 6.1),
135
+ Material("F15 22mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0222, 0.2, 0.6, 12.4),
136
+ Material("F16 Acoustic tile", MaterialCategory.FINISHING_MATERIALS, 0.06, 368.0, 590.0, 0.0191, 1.0, 0.4, 14.0),
137
+ Material("F17 13mm slag", MaterialCategory.FINISHING_MATERIALS, 0.16, 960.0, 1090.0, 0.0127, 0.2, 0.5, 1.0),
138
+ Material("F18 25mm slag", MaterialCategory.FINISHING_MATERIALS, 0.16, 960.0, 1090.0, 0.0254, 0.2, 0.5, 1.9),
139
+ Material("G01 13mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0127, 0.25, 0.4, 5.1),
140
+ Material("G01a 19mm gypsum board", MaterialCategory.FINISHING_MATERIALS, 0.16, 800.0, 1090.0, 0.0191, 0.25, 0.4, 7.6),
141
+ Material("G02 25mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0254, 0.2, 0.6, 14.1),
142
+ Material("G03 13mm lime plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1600.0, 840.0, 0.0127, 0.25, 0.5, 6.1),
143
+ Material("G04 13mm cement plaster", MaterialCategory.FINISHING_MATERIALS, 0.72, 1856.0, 840.0, 0.0127, 0.2, 0.6, 7.1),
144
+ Material("G05 25mm wood", MaterialCategory.SUB_STRUCTURAL_MATERIALS, 0.15, 608.0, 1630.0, 0.0254, 0.3, 0.5, 15.4),
145
+ Material("G06 19mm wood", MaterialCategory.SUB_STRUCTURAL_MATERIALS, 0.15, 608.0, 1630.0, 0.0191, 0.3, 0.5, 11.6),
146
+ Material("I01 25mm insulation board", MaterialCategory.INSULATION, 0.03, 43.0, 1210.0, 0.0254, 2.5, 0.5, 1.1),
147
+ Material("I02 50mm insulation board", MaterialCategory.INSULATION, 0.03, 43.0, 1210.0, 0.0508, 2.5, 0.5, 2.2),
148
+ Material("I03 75mm insulation board", MaterialCategory.INSULATION, 0.03, 43.0, 1210.0, 0.0762, 2.5, 0.5, 3.3),
149
+ Material("M01 100mm brick", MaterialCategory.STRUCTURAL_MATERIALS, 0.89, 1920.0, 790.0, 0.1016, 0.3, 0.7, 19.5),
150
+ Material("M02 100mm face brick", MaterialCategory.STRUCTURAL_MATERIALS, 1.33, 2000.0, 790.0, 0.1016, 0.3, 0.7, 20.3),
151
+ Material("M03 150mm brick", MaterialCategory.STRUCTURAL_MATERIALS, 0.89, 1920.0, 790.0, 0.1524, 0.3, 0.7, 29.3),
152
+ Material("M04 200mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 0.51, 800.0, 920.0, 0.2032, 0.2, 0.65, 13.0),
153
+ Material("M05 200mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 1.11, 1280.0, 920.0, 0.2032, 0.2, 0.65, 20.8),
154
+ Material("M06 150mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 0.51, 800.0, 920.0, 0.1524, 0.2, 0.65, 9.8),
155
+ Material("M07 100mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 0.51, 800.0, 920.0, 0.1016, 0.2, 0.65, 6.5),
156
+ Material("M08 150mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 1.11, 1280.0, 920.0, 0.1524, 0.2, 0.65, 15.6),
157
+ Material("M09 100mm concrete block", MaterialCategory.STRUCTURAL_MATERIALS, 1.11, 1280.0, 920.0, 0.1016, 0.2, 0.65, 10.4),
158
+ Material("M10 100mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.1016, 0.15, 0.65, 7.8),
159
+ Material("M11 100mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.1016, 0.15, 0.65, 7.8),
160
+ Material("M12 150mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.1524, 0.15, 0.65, 11.7),
161
+ Material("M13 200mm lightweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 0.53, 1280.0, 840.0, 0.2032, 0.15, 0.65, 15.6),
162
+ Material("M14 100mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.1016, 0.2, 0.65, 18.2),
163
+ Material("M14a 100mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.1016, 0.2, 0.65, 18.2),
164
+ Material("M15 200mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.2032, 0.2, 0.65, 36.4),
165
+ Material("M16 300mm heavyweight concrete", MaterialCategory.STRUCTURAL_MATERIALS, 1.95, 2240.0, 900.0, 0.3048, 0.2, 0.65, 54.6),
166
+ Material("M17 100mm stone", MaterialCategory.STRUCTURAL_MATERIALS, 2.10, 2240.0, 880.0, 0.1016, 0.2, 0.7, 22.8),
167
+ Material("M18 150mm stone", MaterialCategory.STRUCTURAL_MATERIALS, 2.10, 2240.0, 880.0, 0.1524, 0.2, 0.7, 34.1),
168
+ Material("M19 100mm limestone", MaterialCategory.STRUCTURAL_MATERIALS, 1.80, 2320.0, 880.0, 0.1016, 0.2, 0.6, 23.6),
169
+ Material("M20 150mm limestone", MaterialCategory.STRUCTURAL_MATERIALS, 1.80, 2320.0, 880.0, 0.1524, 0.2, 0.6, 35.4),
170
+ Material("M21 200mm limestone", MaterialCategory.STRUCTURAL_MATERIALS, 1.80, 2320.0, 880.0, 0.2032, 0.2, 0.6, 47.1),
171
+ Material("M22 100mm granite", MaterialCategory.STRUCTURAL_MATERIALS, 2.80, 2640.0, 880.0, 0.1016, 0.2, 0.7, 26.8),
172
+ Material("M23 150mm granite", MaterialCategory.STRUCTURAL_MATERIALS, 2.80, 2640.0, 880.0, 0.1524, 0.2, 0.7, 40.2),
173
+ Material("M24 200mm granite", MaterialCategory.STRUCTURAL_MATERIALS, 2.80, 2640.0, 880.0, 0.2032, 0.2, 0.7, 53.6),
174
+ Material("M25 100mm marble", MaterialCategory.STRUCTURAL_MATERIALS, 2.50, 2720.0, 880.0, 0.1016, 0.2, 0.6, 27.6),
175
+ Material("M26 150mm marble", MaterialCategory.STRUCTURAL_MATERIALS, 2.50, 2720.0, 880.0, 0.1524, 0.2, 0.6, 41.4),
176
+ Material("M27 200mm marble", MaterialCategory.STRUCTURAL_MATERIALS, 2.50, 2720.0, 880.0, 0.2032, 0.2, 0.6, 55.3),
177
  ]
178
  return {mat.name: mat for mat in materials}
179
 
180
+ def initialize_glazing_materials(self) -> Dict[str, GlazingMaterial]:
181
+ glazing_materials = [
182
+ # ASHRAE-based glazing materials with Australian pricing
183
+ GlazingMaterial("Single Clear 3mm", 5.8, 0.81, 25.0, 50.0), # High U-value, high SHGC
184
+ GlazingMaterial("Single Clear 6mm", 5.7, 0.78, 28.0, 60.0), # Slightly lower SHGC
185
+ GlazingMaterial("Single Tinted 6mm", 5.7, 0.55, 30.0, 70.0), # Reduced SHGC for solar control
186
+ GlazingMaterial("Double Clear 6mm/13mm Air", 2.7, 0.70, 40.0, 100.0), # Improved insulation
187
+ GlazingMaterial("Double Low-E 6mm/13mm Air", 1.8, 0.60, 45.0, 120.0), # Low-E coating
188
+ GlazingMaterial("Double Tinted 6mm/13mm Air", 2.7, 0.45, 42.0, 110.0), # Tinted for solar control
189
+ GlazingMaterial("Double Low-E 6mm/13mm Argon", 1.5, 0.55, 48.0, 130.0), # Argon-filled, better U-value
190
+ GlazingMaterial("Triple Clear 4mm/12mm Air", 1.8, 0.62, 55.0, 150.0), # Triple glazing
191
+ GlazingMaterial("Triple Low-E 4mm/12mm Argon", 0.9, 0.50, 60.0, 180.0), # High-performance
192
+ GlazingMaterial("Single Low-E Reflective 6mm", 5.6, 0.35, 35.0, 90.0), # Reflective coating
193
+ GlazingMaterial("Double Reflective 6mm/13mm Air", 2.5, 0.30, 50.0, 140.0), # Low SHGC
194
+ GlazingMaterial("Electrochromic 6mm/13mm Air", 2.0, 0.40, 70.0, 200.0), # Dynamic glazing
195
+ ]
196
+ return {mat.name: mat for mat in glazing_materials}
197
+
198
+ def initialize_door_materials(self) -> Dict[str, DoorMaterial]:
199
+ door_materials = [
200
+ # Door materials with ASHRAE-based properties and Australian pricing
201
+ DoorMaterial("Solid Wood 45mm", 2.5, 0.50, 15.0, 200.0), # Standard wooden door
202
+ DoorMaterial("Insulated Wood 50mm", 1.8, 0.45, 18.0, 250.0), # Better insulation
203
+ DoorMaterial("Hollow Core Wood 40mm", 3.5, 0.50, 12.0, 150.0), # Less insulation
204
+ DoorMaterial("Steel Uninsulated 45mm", 5.0, 0.70, 20.0, 180.0), # High U-value
205
+ DoorMaterial("Steel Insulated 50mm", 2.0, 0.65, 25.0, 220.0), # Foam-insulated
206
+ DoorMaterial("Aluminum Uninsulated 45mm", 6.0, 0.75, 22.0, 200.0), # Poor insulation
207
+ DoorMaterial("Aluminum Insulated 50mm", 2.5, 0.70, 28.0, 240.0), # Thermal break
208
+ DoorMaterial("Glass Single 6mm", 5.7, 0.78, 28.0, 100.0), # Same as single glazing
209
+ DoorMaterial("Glass Double 6mm/13mm Air", 2.7, 0.70, 40.0, 150.0), # Double-glazed door
210
+ DoorMaterial("Fiberglass Insulated 50mm", 1.5, 0.60, 20.0, 230.0), # High performance
211
+ DoorMaterial("PVC Insulated 50mm", 1.7, 0.55, 18.0, 210.0), # Durable, insulated
212
+ DoorMaterial("Wood with Glass Insert", 3.0, 0.65, 16.0, 190.0), # Mixed properties
213
+ ]
214
+ return {mat.name: mat for mat in door_materials}
215
+
216
  def initialize_constructions(self) -> Dict[str, Construction]:
217
  constructions = [
 
218
  Construction("Light Exterior Wall", "Wall", [
219
  {"material": self.library_materials["F08 Metal surface"], "thickness": 0.0008},
220
  {"material": self.library_materials["I02 50mm insulation board"], "thickness": 0.0508},
 
297
  materials.extend(list(project_materials.values()))
298
  return materials
299
 
300
+ def get_all_glazing_materials(self, project_glazing_materials: Optional[Dict[str, GlazingMaterial]] = None) -> List[GlazingMaterial]:
301
+ materials = list(self.library_glazing_materials.values())
302
+ if project_glazing_materials:
303
+ materials.extend(list(project_glazing_materials.values()))
304
+ return materials
305
+
306
+ def get_all_door_materials(self, project_door_materials: Optional[Dict[str, DoorMaterial]] = None) -> List[DoorMaterial]:
307
+ materials = list(self.library_door_materials.values())
308
+ if project_door_materials:
309
+ materials.extend(list(project_door_materials.values()))
310
+ return materials
311
+
312
  def add_project_material(self, material: Material, project_materials: Dict[str, Material]) -> Tuple[bool, str]:
313
  if len(project_materials) >= 20:
314
  return False, "Maximum 20 project materials allowed."
 
317
  project_materials[material.name] = material
318
  return True, f"Material '{material.name}' added to project materials."
319
 
320
+ def add_project_glazing_material(self, material: GlazingMaterial, project_glazing_materials: Dict[str, GlazingMaterial]) -> Tuple[bool, str]:
321
+ if len(project_glazing_materials) >= 20:
322
+ return False, "Maximum 20 project glazing materials allowed."
323
+ if material.name in project_glazing_materials or material.name in self.library_glazing_materials:
324
+ return False, f"Glazing material name '{material.name}' already exists."
325
+ project_glazing_materials[material.name] = material
326
+ return True, f"Glazing material '{material.name}' added to project glazing materials."
327
+
328
+ def add_project_door_material(self, material: DoorMaterial, project_door_materials: Dict[str, DoorMaterial]) -> Tuple[bool, str]:
329
+ if len(project_door_materials) >= 20:
330
+ return False, "Maximum 20 project door materials allowed."
331
+ if material.name in project_door_materials or material.name in self.library_door_materials:
332
+ return False, f"Door material name '{material.name}' already exists."
333
+ project_door_materials[material.name] = material
334
+ return True, f"Door material '{material.name}' added to project door materials."
335
+
336
  def edit_project_material(self, old_name: str, new_material: Material, project_materials: Dict[str, Material],
337
  components: Dict[str, List]) -> Tuple[bool, str]:
338
  if old_name not in project_materials:
 
354
  project_materials[new_material.name] = new_material
355
  return True, f"Material '{old_name}' updated to '{new_material.name}'."
356
 
357
+ def edit_project_glazing_material(self, old_name: str, new_material: GlazingMaterial,
358
+ project_glazing_materials: Dict[str, GlazingMaterial],
359
+ components: Dict[str, List]) -> Tuple[bool, str]:
360
+ if old_name not in project_glazing_materials:
361
+ return False, f"Glazing material '{old_name}' not found in project glazing materials."
362
+ if new_material.name != old_name and (new_material.name in project_glazing_materials or new_material.name in self.library_glazing_materials):
363
+ return False, f"Glazing material name '{new_material.name}' already exists."
364
+ for comp_list in components.values():
365
+ for comp in comp_list:
366
+ if comp.glazing_material and comp.glazing_material.name == old_name:
367
+ comp.glazing_material = new_material
368
+ comp.u_value = new_material.u_value
369
+ comp.shgc = new_material.shgc
370
+ project_glazing_materials.pop(old_name)
371
+ project_glazing_materials[new_material.name] = new_material
372
+ return True, f"Glazing material '{old_name}' updated to '{new_material.name}'."
373
+
374
+ def edit_project_door_material(self, old_name: str, new_material: DoorMaterial,
375
+ project_door_materials: Dict[str, DoorMaterial],
376
+ components: Dict[str, List]) -> Tuple[bool, str]:
377
+ if old_name not in project_door_materials:
378
+ return False, f"Door material '{old_name}' not found in project door materials."
379
+ if new_material.name != old_name and (new_material.name in project_door_materials or new_material.name in self.library_door_materials):
380
+ return False, f"Door material name '{new_material.name}' already exists."
381
+ for comp_list in components.values():
382
+ for comp in comp_list:
383
+ if comp.door_material and comp.door_material.name == old_name:
384
+ comp.door_material = new_material
385
+ comp.u_value = new_material.u_value
386
+ comp.solar_absorptivity = new_material.solar_absorption
387
+ project_door_materials.pop(old_name)
388
+ project_door_materials[new_material.name] = new_material
389
+ return True, f"Door material '{old_name}' updated to '{new_material.name}'."
390
+
391
  def delete_project_material(self, name: str, project_materials: Dict[str, Material], components: Dict[str, List]) -> Tuple[bool, str]:
392
  if name not in project_materials:
393
  return False, f"Material '{name}' not found in project materials."
 
401
  del project_materials[name]
402
  return True, f"Material '{name}' deleted successfully."
403
 
404
+ def delete_project_glazing_material(self, name: str, project_glazing_materials: Dict[str, GlazingMaterial],
405
+ components: Dict[str, List]) -> Tuple[bool, str]:
406
+ if name not in project_glazing_materials:
407
+ return False, f"Glazing material '{name}' not found in project glazing materials."
408
+ for comp_list in components.values():
409
+ for comp in comp_list:
410
+ if comp.glazing_material and comp.glazing_material.name == name:
411
+ return False, f"Cannot delete '{name}' as it is used in component '{comp.name}'."
412
+ del project_glazing_materials[name]
413
+ return True, f"Glazing material '{name}' deleted successfully."
414
+
415
+ def delete_project_door_material(self, name: str, project_door_materials: Dict[str, DoorMaterial],
416
+ components: Dict[str, List]) -> Tuple[bool, str]:
417
+ if name not in project_door_materials:
418
+ return False, f"Door material '{name}' not found in project door materials."
419
+ for comp_list in components.values():
420
+ for comp in comp_list:
421
+ if comp.door_material and comp.door_material.name == name:
422
+ return False, f"Cannot delete '{name}' as it is used in component '{comp.name}'."
423
+ del project_door_materials[name]
424
+ return True, f"Door material '{name}' deleted successfully."
425
+
426
  def add_project_construction(self, construction: Construction, project_constructions: Dict[str, Construction]) -> Tuple[bool, str]:
427
  if len(project_constructions) >= 20:
428
  return False, "Maximum 20 project constructions allowed."
 
461
 
462
  def to_dataframe(self, data_type: str, project_materials: Optional[Dict[str, Material]] = None,
463
  project_constructions: Optional[Dict[str, Construction]] = None,
464
+ project_glazing_materials: Optional[Dict[str, GlazingMaterial]] = None,
465
+ project_door_materials: Optional[Dict[str, DoorMaterial]] = None,
466
  only_project: bool = False) -> pd.DataFrame:
467
  if data_type == "materials":
468
  data = []
 
500
  "Source": "Project" if not cons.is_library else "Library"
501
  })
502
  return pd.DataFrame(data)
503
+ elif data_type == "glazing_materials":
504
+ data = []
505
+ glazing_materials = project_glazing_materials.values() if only_project else self.get_all_glazing_materials(project_glazing_materials)
506
+ for mat in glazing_materials:
507
+ data.append({
508
+ "Name": mat.name,
509
+ "U-Value (W/m虏路K)": mat.u_value,
510
+ "SHGC": mat.shgc,
511
+ "Embodied Carbon (kgCO鈧俥/m虏)": mat.embodied_carbon,
512
+ "Price (USD/m虏)": mat.price,
513
+ "Source": "Project" if not mat.is_library else "Library"
514
+ })
515
+ return pd.DataFrame(data)
516
+ elif data_type == "door_materials":
517
+ data = []
518
+ door_materials = project_door_materials.values() if only_project else self.get_all_door_materials(project_door_materials)
519
+ for mat in door_materials:
520
+ data.append({
521
+ "Name": mat.name,
522
+ "U-Value (W/m虏路K)": mat.u_value,
523
+ "Solar Absorption": mat.solar_absorption,
524
+ "Embodied Carbon (kgCO鈧俥/m虏)": mat.embodied_carbon,
525
+ "Price (USD/m虏)": mat.price,
526
+ "Source": "Project" if not mat.is_library else "Library"
527
+ })
528
+ return pd.DataFrame(data)
529
  return pd.DataFrame()