diff --git a/FoundationDesign/combinedfootingdesign.py b/FoundationDesign/combinedfootingdesign.py index f221da69..5250af18 100644 --- a/FoundationDesign/combinedfootingdesign.py +++ b/FoundationDesign/combinedfootingdesign.py @@ -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( @@ -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): """ @@ -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)) @@ -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( @@ -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): """ @@ -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)) @@ -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()) diff --git a/FoundationDesign/concretedesignfunc.py b/FoundationDesign/concretedesignfunc.py index 40b1f6e5..f9510429 100644 --- a/FoundationDesign/concretedesignfunc.py +++ b/FoundationDesign/concretedesignfunc.py @@ -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): diff --git a/FoundationDesign/foundationdesign.py b/FoundationDesign/foundationdesign.py index 06a44260..98db637f 100644 --- a/FoundationDesign/foundationdesign.py +++ b/FoundationDesign/foundationdesign.py @@ -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( @@ -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): """ @@ -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 @@ -1658,6 +1664,7 @@ 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, @@ -1665,6 +1672,8 @@ def area_of_steel_reqd_Y_dir(self): 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( @@ -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): """ @@ -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 @@ -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, @@ -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) diff --git a/examples/Combined_Footing_Mosley_bungey.ipynb b/examples/Combined_Footing_Mosley_bungey.ipynb index e3d8b209..827b1317 100644 --- a/examples/Combined_Footing_Mosley_bungey.ipynb +++ b/examples/Combined_Footing_Mosley_bungey.ipynb @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -131,7 +131,7 @@ "[0.0, 0.0]" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -165,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -183,7 +183,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -213,7 +213,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -1138,7 +1138,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -1157,7 +1157,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -9351,7 +9351,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -9360,7 +9360,7 @@ "'Provide H16mm bars spaced at 150.0mm c/c TOP.The area provided is 1340mm²/m parallel to the 4.6m side'" ] }, - "execution_count": 26, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -9384,7 +9384,7 @@ } ], "source": [ - "z = comb_footing_design.area_of_steel_reqd_X_dir()\n", + "z = comb_footing_design.area_of_steel_reqd_X_dir()['area_required_per_m']\n", "print(\n", " f\"The area of top steel required in the x direction is {z[0]}mm\\u00b2/m and \\n \\\n", " {z[1]}mm\\u00b2/m bottom steel is required along x direction\"\n", @@ -9393,16 +9393,16 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'Provide H16mm bars spaced at 150.0mm c/c BOTTOM . The area provided is 1340mm²/m parallel to the 4.6m side'" + "'Provide H16mm bars spaced at 150.0mm c/c BOTTOM.The area provided is 1340mm²/m parallel to the 4.6m side'" ] }, - "execution_count": 29, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -9434,7 +9434,7 @@ } ], "source": [ - "z = comb_footing_design.area_of_steel_reqd_Y_dir()\n", + "z = comb_footing_design.area_of_steel_reqd_Y_dir()['area_required_per_m']\n", "print(\n", " f\"The area of top steel required in the Y direction is {z[0]}mm\\u00b2/m and \\n \\\n", " {z[1]}mm\\u00b2/m bottom steel is required along y direction\"\n", @@ -9443,16 +9443,16 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'Provide H16mm bars spaced at 150.0mm c/c TOP. The area provided is 1340mm²/m parallel to the 2.3m side'" + "'Provide H16mm bars spaced at 150.0mm c/c TOP. The area provided is 1340mm²/m parallel to the 2.3m side'" ] }, - "execution_count": 32, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -9463,7 +9463,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -9472,7 +9472,7 @@ "'Provide H16mm bars spaced at 150.0mm c/c Bottom.The area provided is 1340mm²/m parallel to the 2.3m side'" ] }, - "execution_count": 34, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -9483,7 +9483,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -9492,7 +9492,7 @@ "3990.0" ] }, - "execution_count": 35, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -9503,7 +9503,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -9512,7 +9512,7 @@ "'The design shear resistance of 655.528kN exceeds the design shear force of 543.54kN - PASS!!!'" ] }, - "execution_count": 37, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -9523,7 +9523,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -9532,7 +9532,7 @@ "'The design shear resistance of 1318.526kN exceeds the design shear force of 358.27kN - PASS!!!'" ] }, - "execution_count": 39, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -9543,7 +9543,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -9552,7 +9552,7 @@ "1.5" ] }, - "execution_count": 40, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -9563,7 +9563,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -9572,7 +9572,7 @@ "'The maximum punching shear resistance of 4.488N/mm² exceeds the design punching shear stress of 2.565N/mm² - PASS!!!'" ] }, - "execution_count": 42, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -9583,7 +9583,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -9592,7 +9592,7 @@ "'The maximum punching shear resistance of 4.488N/mm² exceeds the design punching shear stress of 2.729N/mm² - PASS!!!'" ] }, - "execution_count": 43, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -9603,7 +9603,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -9612,7 +9612,7 @@ "'The maximum punching shear resistance of 0.703N/mm² exceeds the design punching shear stress of 0.335N/mm² - PASS!!!'" ] }, - "execution_count": 44, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -9620,13 +9620,6 @@ "source": [ "comb_footing_design.col_2_punching_shear_check_1d()['status']" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/examples/Concentric_Footing_Example.ipynb b/examples/Concentric_Footing_Example.ipynb index 6b19f363..22ec881b 100644 --- a/examples/Concentric_Footing_Example.ipynb +++ b/examples/Concentric_Footing_Example.ipynb @@ -11981,7 +11981,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -11993,7 +11993,7 @@ } ], "source": [ - "z = fdn_design.area_of_steel_reqd_X_dir()\n", + "z = fdn_design.area_of_steel_reqd_X_dir()['area_required_per_m']\n", "print(f'The area of steel required in the x direction is {z}mm\\u00b2/m')" ] }, @@ -12007,7 +12007,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -12019,7 +12019,7 @@ } ], "source": [ - "z = fdn_design.area_of_steel_reqd_Y_dir()\n", + "z = fdn_design.area_of_steel_reqd_Y_dir()['area_required_per_m']\n", "print(f'The area of steel required in the Y direction is {z}mm\\u00b2/m')" ] }, @@ -12033,7 +12033,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -12042,7 +12042,7 @@ "'Provide H16mm bars spaced at 200.0mm c/c bottom. The area provided is 1005mm²/m parallel to the 2.5m side'" ] }, - "execution_count": 19, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -12061,7 +12061,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -12070,7 +12070,7 @@ "'Provide H12mm bars spaced at 125.0mm c/c bottom. The area provided is 905mm²/m parallel to the 2.5m side'" ] }, - "execution_count": 20, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -12089,7 +12089,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -12098,7 +12098,7 @@ "'The design shear resistance of 570.395kN exceeds the design shear force of 274.176kN - PASS!!!'" ] }, - "execution_count": 21, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -12117,7 +12117,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -12126,7 +12126,7 @@ "'The design shear resistance of 574.91kN exceeds the design shear force of 283.968kN - PASS!!!'" ] }, - "execution_count": 22, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -12145,7 +12145,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -12154,7 +12154,7 @@ "'The maximum punching shear resistance of 4.488N/mm² exceeds the design punching shear stress of 1.61N/mm² - PASS!!!'" ] }, - "execution_count": 23, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -12173,7 +12173,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -12182,7 +12182,7 @@ "'The maximum punching shear resistance of 0.762N/mm² exceeds the design punching shear stress of 0.312N/mm² - PASS!!!'" ] }, - "execution_count": 24, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -12201,7 +12201,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -12210,7 +12210,7 @@ "'The maximum punching shear resistance of 0.381N/mm² exceeds the design punching shear stress of -0.011N/mm² - PASS!!!'" ] }, - "execution_count": 25, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -12221,7 +12221,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -12230,7 +12230,7 @@ "' The allowable sliding resistance 327kN is greater than the actual horizontal loads 0kN Status - PASS!!!'" ] }, - "execution_count": 26, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -12238,11 +12238,18 @@ "source": [ "fdn_design.sliding_resistance_check()['status']" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3.9.7 64-bit", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -12258,12 +12265,7 @@ "pygments_lexer": "ipython3", "version": "3.10.4" }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "f6246b25e200e4c5124e3e61789ac81350562f0761bbcf92ad9e48654207659c" - } - } + "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/test_PadFoundationDesign.py b/tests/test_PadFoundationDesign.py index 9855e96b..504e86cf 100644 --- a/tests/test_PadFoundationDesign.py +++ b/tests/test_PadFoundationDesign.py @@ -45,8 +45,8 @@ def test_foundation_plots(self): def test_reinforcement_calculations(self): pad_foundation_design = self.pad_foundation_design - self.assertEqual(pad_foundation_design.area_of_steel_reqd_X_dir(), 958) - self.assertEqual(pad_foundation_design.area_of_steel_reqd_Y_dir(), 747) + self.assertEqual(pad_foundation_design.area_of_steel_reqd_X_dir()['area_required_per_m'], 958) + self.assertEqual(pad_foundation_design.area_of_steel_reqd_Y_dir()['area_required_per_m'], 747) self.assertDictEqual( pad_foundation_design.reinforcement_provision_flexure_X_dir(), {