Composite Shapes#
In this example a composite section is built by joining multiple basic shapes.
from xsection import CompositeSection
from xsection.library import Circle, Equigon
from xara_units.iks import inch, foot, ksi, kip
import matplotlib.pyplot as plt
import numpy as np
Concrete Circle#
We begin by specifying the dimensions of our section.
d = 7/8*inch
ds = 2/8*inch # diameter of the shear spiral
cover = 1*inch + ds
diameter = 15*inch
core_radius = diameter/2 - cover - ds - d/2
nr = 20 # number of longitudinal reinforcing bars
Next we’ll create the shapes which make up our composite geometry.
To handle overlapping regions, each shape is assigned an integer index z. When two shapes overlap, the one with the larger z takes priority.
This mechanism allows us to represent the cover and core regions. We first create a circle exterior with z=0 to represent the cover. Next, we define the core as another circle with a smaller radius but larger z (here z=1). Because of the higher z value, the core “cuts out” the corresponding area from the cover.
Like all simple shapes in xsection, the Circle class is just a wrapper around the Polygon shape. For this reason, we use the divisions argument to indicate how many polygon edges should be used to approximate the smooth geometry of a circle.
The mesh_scale argument dictates roughly how many integration points should be generated within the shape.
# Define the exterior shape
exterior = Circle(diameter/2, z=0,
name="cover", divisions=60, mesh_scale=1/80)
interior = Equigon(core_radius, z=1,
name="core", divisions=nr, mesh_scale=1/20)
The reinforcing bars are defined separately as small circles. Because stresses generally don’t vary drastically within individual reinforcing bars, we’ll use a much coarser circle approximation by setting divisions=4 and mesh_scale=2.
The location of the first bar is given explicitly, and the remaining bars are generated automatically by evenly spacing them around the core.
# A single representative rebar
one_bar = Circle(d/2, z=2, mesh_scale=1/2, divisions=4, name="rebar")
# Location of the first bar; the rest will be generated
# by linearly spacing them around an arc
xr = ((diameter/2) - cover - ds - d/2, 0)
bars = one_bar.linspace(xr, xr, nr, endpoint=False, center=(0,0))
Finally, we assemble all parts—the cover (interior), the core (exterior), and the bars—into a single CompositeSection.
# Create the composite section
shape = CompositeSection([
exterior,
interior,
*bars
])
import veux
print(shape.elastic.summary())
artist = veux.create_artist(shape.model) #veux.model.FiberModel(shape.create_fibers()))
# artist.draw_samples()
artist.draw_outlines()
artist.draw_surfaces()
artist
Iy : 2485
Iz : 2485
A : 176.7
Ay : 151.6
Az : 151.6
J : 4970
Iyz : -2.546e-14
Moment-Curvature#
from xsection.analysis import SectionInteraction
# Define materials
mat = [
{ # Confined
"name": "core",
"type": "Concrete02",
"Fc": 7.08*ksi,
"ec0": 0.00295,
"Fcu": 5*ksi,
"ecu": 0.014,
},
{ # Unconfined
"name": "cover",
"type": "Concrete02",
"Fc": -6.5*ksi,
"ec0": -0.002,
"Fcu": -0.5*ksi,
"ecu": -0.005,
# "lambda": 0.1,
# "Ft": 0.65*ksi,
# "Ets": 500. # Tension stiffening
},
{
"name": "rebar",
"type": "Steel01",
"E": 29e3*ksi,
"Fy": 40*ksi,
"b": 0.01
}
]
#
# Setup the interaction analysis
#
# Define axial load range
axial = np.linspace(-1200*kip, 250*kip, 15)
si = SectionInteraction(("Fiber", shape, mat), axial=axial)
fig, ax = plt.subplots(1,2, sharey=True, constrained_layout=True, figsize=(10, 5))
mmax = []
for n, m, k in si.moment_curvature():
ax[0].plot(k, np.array(m)/foot, '-')
# ax[1].plot([n]*len(m), m, '-', lw=0.3, markersize=0.5)
ax[1].plot([n], [max(m)/foot], 'o')
ax[0].axvline(0, color="k", lw=1)
ax[0].axhline(0, color="k", lw=1)
ax[1].axvline(0, color="k", lw=1)
ax[1].axhline(0, color="k", lw=1)
ax[0].set_xlabel("Curvature, $\\kappa$")
ax[0].set_ylabel("Moment, $M(\\varepsilon, \\kappa)$")
ax[1].set_xlabel("Axial force, $P$");
FAILURE :: Iter: 20, Norm: 306.883, Norm deltaX: 0.000512427
FAILURE :: Iter: 20, Norm: 5.08397, Norm deltaX: 0.000256116
Rectangle#
from xsection.library import Rectangle, Circle
from xsection import CompositeSection
h = 24
b = 15
d = 7/8
r = 0 #d/2
c = 1.5
bar = Circle(d/2, z=2, mesh_scale=1/2, divisions=4, name="rebar")
shape = CompositeSection([
Rectangle( b, h, z=0, name="cover"),
Rectangle(b-2*c, h-2*c, z=1, name="core"),
*bar.linspace([-b/2+c+r, -h/2+c+r], [ b/2-c-r,-h/2+c+r], 3), # Top bars
*bar.linspace([-b/2+c+r, 0], [ b/2-c-r, 0], 2), # Center bars
*bar.linspace([-b/2+c+r, h/2-c-r], [ b/2-c-r, h/2-c-r], 3) # Bottom bars
])
print(shape.elastic.summary())
artist = veux.create_artist(shape.model) #veux.model.FiberModel(shape.create_fibers()))
# artist.draw_samples()
artist.draw_outlines()
artist.draw_surfaces()
artist
Iy : 1.728e+04
Iz : 6750
A : 360
Ay : 302.1
Az : 300.9
J : 1.669e+04
Iyz : -4.157e-13