Skip to content

Commit dfd3047

Browse files
committed
Update other concrete geometry generation functions to include updated behaviour for calculating bar area
1 parent 1ac8965 commit dfd3047

File tree

1 file changed

+27
-46
lines changed

1 file changed

+27
-46
lines changed

sectionproperties/pre/library/concrete_sections.py

Lines changed: 27 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -92,39 +92,30 @@ def concrete_rectangular_section(
9292
x_i_bot = cover + dia_bot / 2
9393
spacing_top = (b - 2 * cover - dia_top) / (n_top - 1)
9494
spacing_bot = (b - 2 * cover - dia_bot) / (n_bot - 1)
95+
96+
if area_top is None:
97+
area_top = np.pi * dia_top**2 / 4
98+
if area_bottom is None:
99+
area_bottom = np.pi * dia_bot**2 / 4
95100

96101
# add top bars
97102
for i in range(n_top):
98-
if area_top:
99-
bar = primitive_sections.circular_section_by_area(
100-
area=area_top, n=n_circle, material=steel_mat
101-
)
102-
else:
103-
bar = primitive_sections.circular_section(
104-
d=dia_top, n=n_circle, material=steel_mat
105-
)
106-
103+
bar = primitive_sections.circular_section_by_area(
104+
area=area_top, n=n_circle, material=steel_mat
105+
)
107106
bar = bar.shift_section(
108107
x_offset=x_i_top + spacing_top * i, y_offset=d - cover - dia_top / 2
109108
)
110-
111109
geom = (geom - bar) + bar
112110

113111
# add bot bars
114112
for i in range(n_bot):
115-
if area_bot:
116-
bar = primitive_sections.circular_section_by_area(
117-
area=area_bot, n=n_circle, material=steel_mat
118-
)
119-
else:
120-
bar = primitive_sections.circular_section(
121-
d=dia_bot, n=n_circle, material=steel_mat
122-
)
123-
113+
bar = primitive_sections.circular_section_by_area(
114+
area=area_bot, n=n_circle, material=steel_mat
115+
)
124116
bar = bar.shift_section(
125117
x_offset=x_i_bot + spacing_bot * i, y_offset=cover + dia_bot / 2
126118
)
127-
128119
geom = (geom - bar) + bar
129120

130121
return geom
@@ -346,16 +337,16 @@ def concrete_tee_section(
346337
spacing_top = (b_f - 2 * cover - dia_top) / (n_top - 1)
347338
spacing_bot = (b - 2 * cover - dia_bot) / (n_bot - 1)
348339

340+
if area_top is None:
341+
area_top = np.pi * dia_top**2 / 4
342+
if area_bot is None:
343+
area_bot = np.pi * dia_bot**2 / 4
344+
349345
# add top bars
350346
for i in range(n_top):
351-
if area_top:
352-
bar = primitive_sections.circular_section_by_area(
353-
area=area_top, n=n_circle, material=steel_mat
354-
)
355-
else:
356-
bar = primitive_sections.circular_section(
357-
d=dia_top, n=n_circle, material=steel_mat
358-
)
347+
bar = primitive_sections.circular_section_by_area(
348+
area=area_top, n=n_circle, material=steel_mat
349+
)
359350

360351
bar = bar.shift_section(
361352
x_offset=x_i_top + spacing_top * i, y_offset=d - cover - dia_top / 2
@@ -365,14 +356,9 @@ def concrete_tee_section(
365356

366357
# add bot bars
367358
for i in range(n_bot):
368-
if area_bot:
369-
bar = primitive_sections.circular_section_by_area(
370-
area=area_bot, n=n_circle, material=steel_mat
371-
)
372-
else:
373-
bar = primitive_sections.circular_section(
374-
d=dia_bot, n=n_circle, material=steel_mat
375-
)
359+
bar = primitive_sections.circular_section(
360+
d=dia_bot, n=n_circle, material=steel_mat
361+
)
376362

377363
bar = bar.shift_section(
378364
x_offset=x_i_bot + spacing_bot * i, y_offset=cover + dia_bot / 2
@@ -465,20 +451,15 @@ def concrete_circular_section(
465451
r = d / 2 - cover - dia / 2
466452
d_theta = 2 * np.pi / n_bar
467453

454+
if area_bar is None:
455+
area_bar = np.pi * dia**2 / 4
468456
for i in range(n_bar):
469-
if area_bar:
470-
bar = primitive_sections.circular_section_by_area(
471-
area=area_bar, n=n_circle, material=steel_mat
472-
)
473-
else:
474-
bar = primitive_sections.circular_section(
475-
d=dia, n=n_circle, material=steel_mat
476-
)
477-
457+
bar = primitive_sections.circular_section_by_area(
458+
area=area_bar, n=n_circle, material=steel_mat
459+
)
478460
bar = bar.shift_section(
479461
x_offset=r * np.cos(i * d_theta), y_offset=r * np.sin(i * d_theta)
480462
)
481-
482463
geom = (geom - bar) + bar
483464

484465
return geom

0 commit comments

Comments
 (0)