@@ -397,7 +397,7 @@ def concrete_tee_section(
397397
398398 Example:
399399 The following example creates a 900 mm deep x 450 mm wide concrete tee beam with
400- a 150 mm deep x 1800 mm wide flange. The tee beam is reinforced with 5 x 24 mm
400+ a 150 mm deep x 1800 mm wide flange. The tee beam is reinforced with 12 x 24 mm
401401 top bars, 5 x 28 mm bottom bars and 4 x 16 mm side bars, with 42 mm cover all
402402 around (30 mm cover + 12 mm tie). A coarse finite element mesh is generated to
403403 show the different material regions:
@@ -434,7 +434,7 @@ def concrete_tee_section(
434434 b_f=1800,
435435 dia_top=24,
436436 area_top=450,
437- n_top=5 ,
437+ n_top=12 ,
438438 c_top=42,
439439 dia_bot=28,
440440 area_bot=620,
@@ -452,38 +452,91 @@ def concrete_tee_section(
452452 geom.create_mesh(mesh_sizes=[0]) # a size of zero creates a coarse mesh
453453 Section(geometry=geom).plot_mesh()
454454 """
455- # generate rectangular section of the beam
456- geom = concrete_rectangular_section (
457- d = d ,
458- b = b ,
459- dia_top = dia_top ,
460- area_top = area_top ,
461- n_top = n_top ,
462- c_top = c_top ,
463- dia_bot = dia_bot ,
464- area_bot = area_bot ,
465- n_bot = n_bot ,
466- c_bot = c_bot ,
467- dia_side = dia_side ,
468- area_side = area_side ,
469- n_side = n_side ,
470- c_side = c_side ,
471- n_circle = n_circle ,
472- conc_mat = conc_mat ,
473- steel_mat = steel_mat ,
455+ # generate concrete geometry
456+ beam = primitive_sections .rectangular_section (b = b , d = d - d_f , material = conc_mat )
457+ flange = primitive_sections .rectangular_section (b = b_f , d = d_f , material = conc_mat )
458+ geom = beam + flange .align_to (other = beam , on = "top" ).shift_section (
459+ x_offset = - (b_f / 2 - b / 2 )
474460 )
461+ geom = geom .shift_section (x_offset = - b / 2 )
475462
476- # add flange
477- left_flange = (
478- primitive_sections .rectangular_section (
479- d = d_f , b = (b_f - b ) / 2 , material = conc_mat
463+ # calculate reinforcing bar dimensions for top and bottom layers
464+ if n_top == 1 :
465+ x_i_top = 0
466+ spacing_top = 0
467+ else :
468+ if c_side :
469+ x_i_top = - b_f / 2 + c_side + dia_top / 2
470+ spacing_top = (b_f - 2 * c_side - dia_top ) / (n_top - 1 )
471+ else :
472+ x_i_top = - b_f / 2 + c_top + dia_top / 2
473+ spacing_top = (b_f - 2 * c_top - dia_top ) / (n_top - 1 )
474+
475+ if n_bot == 1 :
476+ x_i_bot = 0
477+ spacing_bot = 0
478+ else :
479+ if c_side :
480+ x_i_bot = - b / 2 + c_side + dia_bot / 2
481+ spacing_bot = (b - 2 * c_side - dia_bot ) / (n_bot - 1 )
482+ else :
483+ x_i_bot = - b / 2 + c_bot + dia_bot / 2
484+ spacing_bot = (b - 2 * c_bot - dia_bot ) / (n_bot - 1 )
485+
486+ # calculate reinforcing bar dimensions for side layers if specified
487+ if dia_side and n_side != 0 :
488+ x_i_side_left = - b / 2 + c_side + dia_side / 2
489+ x_i_side_right = - x_i_side_left
490+
491+ spacing_side = (d - c_top - c_bot - dia_top / 2 - dia_bot / 2 ) / (n_side + 1 )
492+ else :
493+ x_i_side_left = 0
494+ x_i_side_right = 0
495+ spacing_side = 0
496+
497+ # add top bars
498+ for idx in range (n_top ):
499+ bar = primitive_sections .circular_section_by_area (
500+ area = area_top ,
501+ n = n_circle ,
502+ material = steel_mat ,
503+ ).shift_section (
504+ x_offset = x_i_top + spacing_top * idx ,
505+ y_offset = d - c_top - dia_top / 2 ,
480506 )
481- .align_to (other = geom , on = "left" )
482- .align_to (other = geom , on = "top" , inner = True )
483- )
484- right_flange = left_flange .mirror_section (axis = "y" , mirror_point = (b / 2 , 0 ))
507+ geom = (geom - bar ) + bar
485508
486- return geom + left_flange + right_flange
509+ # add bot bars
510+ for i in range (n_bot ):
511+ bar = primitive_sections .circular_section_by_area (
512+ area = area_bot ,
513+ n = n_circle ,
514+ material = steel_mat ,
515+ ).shift_section (
516+ x_offset = x_i_bot + spacing_bot * i ,
517+ y_offset = c_bot + dia_bot / 2 ,
518+ )
519+ geom = (geom - bar ) + bar
520+
521+ # add side bars
522+ if area_side :
523+ for i in range (n_side ):
524+ bar_left = primitive_sections .circular_section_by_area (
525+ area = area_side ,
526+ n = n_circle ,
527+ material = steel_mat ,
528+ ).shift_section (
529+ x_offset = x_i_side_left ,
530+ y_offset = c_bot + dia_bot / 2 + spacing_side * (i + 1 ),
531+ )
532+ bar_right = bar_left .shift_section (x_offset = x_i_side_right - x_i_side_left )
533+
534+ geom = (geom - bar_left - bar_right ) + bar_left + bar_right
535+
536+ if isinstance (geom , geometry .CompoundGeometry ):
537+ return geom
538+ else :
539+ raise ValueError ("Concrete section generation failed." )
487540
488541
489542def concrete_circular_section (
0 commit comments