Skip to content

Commit acb77bb

Browse files
Merge pull request #245 from Agent6-6-6/concrete_rectangular_section-add-side-bars-function
add option for side bars to rect concrete section
2 parents 5a49085 + 8bbdd7d commit acb77bb

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

sectionproperties/pre/library/concrete_sections.py

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ def concrete_rectangular_section(
1414
n_bot: int,
1515
n_circle: int,
1616
cover: float,
17+
dia_side: float = None,
18+
n_side: int = 0,
1719
area_top: float = None,
1820
area_bot: float = None,
21+
area_side: float = None,
1922
conc_mat: pre.Material = pre.DEFAULT_MATERIAL,
2023
steel_mat: pre.Material = pre.DEFAULT_MATERIAL,
2124
) -> geometry.CompoundGeometry:
2225
"""Constructs a concrete rectangular section of width *b* and depth *d*, with
2326
*n_top* top steel bars of diameter *dia_top*, *n_bot* bottom steel bars of diameter
24-
*dia_bot*, discretised with *n_circle* points with equal side and top/bottom
25-
*cover* to the steel.
27+
*dia_bot*, *n_side* left & right side steel bars of diameter *dia_side* discretised
28+
with *n_circle* points with equal side and top/bottom *cover* to the steel.
2629
2730
:param float b: Concrete section width
2831
:param float d: Concrete section depth
@@ -32,18 +35,23 @@ def concrete_rectangular_section(
3235
:param int n_bot: Number of bottom steel reinforcing bars
3336
:param int n_circle: Number of points discretising the steel reinforcing bars
3437
:param float cover: Side and bottom cover to the steel reinforcing bars
38+
:param float dia_side: If provided, diameter of the side steel reinforcing bars
39+
:param int n_side: If provided, number of side bars either side of the section
3540
:param float area_top: If provided, constructs top reinforcing bars based on their
3641
area rather than diameter (prevents the underestimation of steel area due to
3742
circle discretisation)
3843
:param float area_bot: If provided, constructs bottom reinforcing bars based on
3944
their area rather than diameter (prevents the underestimation of steel area due
4045
to circle discretisation)
46+
:param float area_side: If provided, constructs side reinforcing bars based on
47+
their area rather than diameter (prevents the underestimation of steel area due
48+
to circle discretisation)
4149
:param Optional[sectionproperties.pre.pre.Material] conc_mat: Material to
4250
associate with the concrete
4351
:param Optional[sectionproperties.pre.pre.Material] steel_mat: Material to
4452
associate with the steel
4553
46-
:raises ValueErorr: If the number of bars is not greater than or equal to 2 in an
54+
:raises ValueError: If the number of bars is not greater than or equal to 2 in an
4755
active layer
4856
4957
The following example creates a 600D x 300W concrete beam with 3N20 bottom steel
@@ -86,12 +94,18 @@ def concrete_rectangular_section(
8694
# create rectangular concrete geometry
8795
geom = primitive_sections.rectangular_section(b=b, d=d, material=conc_mat)
8896

89-
# calculate reinforcing bar dimensions
97+
# calculate reinforcing bar dimensions for top and bottom layers
9098
x_i_top = cover + dia_top / 2
9199
x_i_bot = cover + dia_bot / 2
92100
spacing_top = (b - 2 * cover - dia_top) / (n_top - 1)
93101
spacing_bot = (b - 2 * cover - dia_bot) / (n_bot - 1)
94102

103+
# calculate reinforcing bar dimensions for side layers if specified
104+
if n_side != 0:
105+
x_i_side_left = cover + dia_side / 2
106+
x_i_side_right = b - x_i_side_left
107+
spacing_side = (d - 2 * cover - dia_top / 2 - dia_bot / 2) / (n_side + 1)
108+
95109
# add top bars
96110
for i in range(n_top):
97111
if area_top:
@@ -126,6 +140,31 @@ def concrete_rectangular_section(
126140

127141
geom = (geom - bar) + bar
128142

143+
# add side bars if specified
144+
if n_side != 0:
145+
for i in range(n_side):
146+
if area_side:
147+
bar_left = primitive_sections.circular_section_by_area(
148+
area=area_side, n=n_circle, material=steel_mat
149+
)
150+
bar_right = bar_left
151+
else:
152+
bar_left = primitive_sections.circular_section(
153+
d=dia_side, n=n_circle, material=steel_mat
154+
)
155+
bar_right = bar_left
156+
157+
bar_left = bar_left.shift_section(
158+
x_offset=x_i_side_left,
159+
y_offset=cover + dia_bot / 2 + spacing_side * (i + 1),
160+
)
161+
bar_right = bar_right.shift_section(
162+
x_offset=x_i_side_right,
163+
y_offset=cover + dia_bot / 2 + spacing_side * (i + 1),
164+
)
165+
166+
geom = (geom - bar_left - bar_right) + bar_left + bar_right
167+
129168
return geom
130169

131170

0 commit comments

Comments
 (0)