Skip to content

Commit

Permalink
"Updated CombinedFootingDesign and PadFoundationDesign classes to ret…
Browse files Browse the repository at this point in the history
…urn dictionaries with 'area_required_per_m' and 'compression_status' keys; modified corresponding test cases and example notebooks to accommodate these changes."
  • Loading branch information
kunle009 committed Oct 31, 2024
1 parent f74f811 commit 376a00e
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 87 deletions.
63 changes: 58 additions & 5 deletions FoundationDesign/combinedfootingdesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,9 @@ def area_of_steel_reqd_X_dir(self):
self.fyk,
self.CombinedFootingAnalysis.foundation_width * 1000,
)
compression_status = area_of_steel_required_calc["compression_status"]
area_of_steel_required_calc = area_of_steel_required_calc["area_of_steel"]

area_of_steel_required = max(
area_of_steel_required_calc,
minimum_steel(
Expand All @@ -2487,7 +2490,10 @@ def area_of_steel_reqd_X_dir(self):
area_required_per_m[i] = (
area_of_steel_required / self.CombinedFootingAnalysis.foundation_width
)
return area_required_per_m.round(2)
return {
"area_required_per_m": area_required_per_m.round(2),
"compression_status": compression_status,
}

def __reinforcement_calculations_X_dir(self):
"""
Expand All @@ -2506,7 +2512,7 @@ def __reinforcement_calculations_X_dir(self):
# appropriate tp satisfy the reinforcement requirement
# but for now i have coded a function to automatically select area of reinforcement based on
# the area of steel required initially calculated
as_required = np.array(self.area_of_steel_reqd_X_dir())
as_required = np.array(self.area_of_steel_reqd_X_dir()["area_required_per_m"])
result = []
for i in range(0, 2, 1):
result.append(reinforcement_provision(as_required[i], self.fyk))
Expand Down Expand Up @@ -2607,6 +2613,8 @@ def area_of_steel_reqd_Y_dir(self):
self.fyk,
self.CombinedFootingAnalysis.foundation_length * 1000,
)
compression_status = area_of_steel_required_calc["compression_status"]
area_of_steel_required_calc = area_of_steel_required_calc["area_of_steel"]
area_of_steel_required = max(
area_of_steel_required_calc,
minimum_steel(
Expand All @@ -2619,7 +2627,10 @@ def area_of_steel_reqd_Y_dir(self):
area_required_per_m[i] = (
area_of_steel_required / self.CombinedFootingAnalysis.foundation_length
)
return area_required_per_m.round(2)
return {
"area_required_per_m": area_required_per_m.round(2),
"compression_status": compression_status,
}

def __reinforcement_calculations_Y_dir(self):
"""
Expand All @@ -2635,8 +2646,7 @@ def __reinforcement_calculations_Y_dir(self):
# spacing this would give power to the user to enable the user chose
# the steel that he founds appropriate tp satisfy the reinforcement requirement
# but for now i have coded a function to automatically select area
# of reinforcement based on the area of steel required initially calculated
as_required = np.array(self.area_of_steel_reqd_Y_dir())
as_required = np.array(self.area_of_steel_reqd_Y_dir()["area_required_per_m"])
result = []
for i in range(0, 2, 1):
result.append(reinforcement_provision(as_required[i], self.fyk))
Expand Down Expand Up @@ -3685,3 +3695,46 @@ def col_2_punching_shear_check_2d(self):
"shear_resistance_max": self.__punching_shear()[1],
"status": status,
}


if __name__ == "__main__":
comb_footing = CombinedFootingAnalysis(
foundation_length=4600,
foundation_width=2300,
soil_bearing_capacity=300,
spacing_btwn_columns=3000,
)
comb_footing.update_column_1_geometry(
column_length=300, column_width=300, col_pos_xdir=540, col_pos_ydir=1145
)
comb_footing.update_column_2_geometry(
column_length=400, column_width=400, col_pos_xdir=3540, col_pos_ydir=1145
)
# Updating column 1 loads
comb_footing.update_column_1_axial_loads(
permanent_axial_load=1000, imposed_axial_load=200
)
# Updating column 2 loads
comb_footing.update_column_2_axial_loads(
permanent_axial_load=1400, imposed_axial_load=300
)
# Update foundation loads
comb_footing.foundation_loads(
foundation_thickness=850,
soil_depth_abv_foundation=0,
soil_unit_weight=18,
concrete_unit_weight=24,
consider_self_weight=False,
)
comb_footing_design = CombinedFootingDesign(
comb_footing,
fck=30,
fyk=500,
concrete_cover=30,
bar_diameterX=16,
bar_diameterY=16,
)
print(comb_footing_design.area_of_steel_reqd_X_dir())
print(comb_footing_design.area_of_steel_reqd_Y_dir())
print(comb_footing_design.reinforcement_prov_flexure_X_dir_TOP())
print(comb_footing_design.reinforcement_prov_flexure_X_dir_Bottom())
8 changes: 6 additions & 2 deletions FoundationDesign/concretedesignfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,19 @@ def bending_reinforcement(
float
Area of steel required in mm2
"""
compression_status = None
depth = depth * 1000
k = (m * 10**6) / (fck * length * (depth**2.0))
if k > 0.167:
print("Compression Reinforcement required, design out of scope")
compression_status = "Compression Reinforcement required, design out of scope"
la = 0.5 + math.sqrt(0.25 - (0.882 * k))
if la >= 0.95:
la = 0.95
area_of_steel = (m * 10**6) / (0.87 * fyk * la * depth)
return round(area_of_steel, 0)
return {
"area_of_steel": round(area_of_steel),
"compression_status": compression_status,
}


def minimum_steel(fck: float, fyk: float, bt: float, d: float):
Expand Down
28 changes: 21 additions & 7 deletions FoundationDesign/foundationdesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,9 @@ def area_of_steel_reqd_X_dir(self):
area_of_steel_required_calc = bending_reinforcement(
Med, self.dx, self.fck, self.fyk, self.PadFoundation.foundation_width * 1000
)
compression_status = area_of_steel_required_calc["compression_status"]
area_of_steel_required_calc = area_of_steel_required_calc["area_of_steel"]

area_of_steel_required = max(
area_of_steel_required_calc,
minimum_steel(
Expand All @@ -1595,7 +1598,10 @@ def area_of_steel_reqd_X_dir(self):
area_required_per_m = (
area_of_steel_required / self.PadFoundation.foundation_width
)
return round(area_required_per_m)
return {
"area_required_per_m": round(area_required_per_m),
"compression_status": compression_status,
}

def __reinforcement_calculations_X_dir(self):
"""
Expand All @@ -1609,7 +1615,7 @@ def __reinforcement_calculations_X_dir(self):
# In developing the web front end version of this code there would be a combobox that includes the bar diameters and equivalent reinforcement
# spacing this would give power to the user to enable the user chose the steel that he founds appropriate tp satisfy the reinforcement requirement
# but for now i have coded a function to automatically select area of reinforcement based on the area of steel required initially calculated
as_required = self.area_of_steel_reqd_X_dir()
as_required = self.area_of_steel_reqd_X_dir()["area_required_per_m"]
result = reinforcement_provision(as_required, self.fyk)
return result

Expand Down Expand Up @@ -1658,13 +1664,16 @@ def area_of_steel_reqd_Y_dir(self):
area of steel required in the y direction. (default unit mm2/m)
"""
Med = self.get_design_moment_Y()

area_of_steel_required_calc = bending_reinforcement(
Med,
self.dy,
self.fck,
self.fyk,
self.PadFoundation.foundation_length * 1000,
)
compression_status = area_of_steel_required_calc["compression_status"]
area_of_steel_required_calc = area_of_steel_required_calc["area_of_steel"]
area_of_steel_required = max(
area_of_steel_required_calc,
minimum_steel(
Expand All @@ -1674,7 +1683,10 @@ def area_of_steel_reqd_Y_dir(self):
area_required_per_m = (
area_of_steel_required / self.PadFoundation.foundation_length
)
return round(area_required_per_m)
return {
"area_required_per_m": round(area_required_per_m),
"compression_status": compression_status,
}

def __reinforcement_calculations_Y_dir(self):
"""
Expand All @@ -1688,7 +1700,7 @@ def __reinforcement_calculations_Y_dir(self):
# In developing the web front end version of this code there would be a combobox that includes the bar diameters and equivalent reinforcement
# spacing this would give power to the user to enable the user chose the steel that he founds appropriate tp satisfy the reinforcement requirement
# but for now i have coded a function to automatically select area of reinforcement based on the area of steel required initially calculated
as_required = self.area_of_steel_reqd_Y_dir()
as_required = self.area_of_steel_reqd_Y_dir()["area_required_per_m"]
result = reinforcement_provision(as_required, self.fyk)
return result

Expand Down Expand Up @@ -2259,8 +2271,8 @@ def sliding_resistance_check(self):

if __name__ == "__main__":
fdn = PadFoundation(
foundation_length=2500,
foundation_width=2500,
foundation_length=2400,
foundation_width=2400,
column_length=400,
column_width=400,
col_pos_xdir=1250,
Expand All @@ -2273,10 +2285,12 @@ def sliding_resistance_check(self):
soil_unit_weight=18,
concrete_unit_weight=24,
)
fdn.bearing_pressure_check_sls()
fdn.column_axial_loads(10000, 3000, 2300)
print(fdn.bearing_pressure_check_sls())
fdn_design = padFoundationDesign(
fdn, fck=30, fyk=500, concrete_cover=40, bar_diameterX=16, bar_diameterY=16
)
print(fdn_design.area_of_steel_reqd_X_dir())
# print(fdn_design.reinforcement_provision_flexure_X_dir())
# fdn_design.sliding_resistance_check()
# fdn_design.plot_foundation_loading_Y(show_plot=False)
Loading

0 comments on commit 376a00e

Please sign in to comment.