Skip to content

Commit 6020d26

Browse files
committed
Create test_girder.py
1 parent 5ec6e26 commit 6020d26

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

tests/test_girder.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
import pytest
3+
from xsection.library._asbi import create_asbi, SingleCellGirder
4+
from xsection.analysis import SaintVenantSectionAnalysis
5+
from xsection._benchmarks import load_shape
6+
r"""
7+
2400-2:
8+
\begin{tabular}{|l|l|l|l|l|l|}
9+
\hline Deck Width (mm) & 'A' (mm) & Area (mm²) & $\mathrm{Wt} / 3,000 \mathrm{~mm}$ (Kn) & lx ( $\mathrm{m}^4$ ) & Yt (mm) \\
10+
10,800 & 0 & 6.327,000 & 463 & 5.045 & 882 \\
11+
11,100 & 150 & 6,395,000 & 468 & 5.085 & 874 \\
12+
11,400 & 300 & 6,462,000 & 473 & 5.124 & 866 \\
13+
11,700 & 450 & 6,530,000 & 478 & 5.162 & 858 \\
14+
12,000 & 600 & 6,597,000 & 483 & 5.199 & 851 \\
15+
12,300 & 750 & 6,665,000 & 488 & 5.236 & 843 \\
16+
12,600 & 900 & 6,732,000 & 493 & 5.272 & 836 \\
17+
12,900 & 1,050 & 6,800,000 & 498 & 5.307 & 829 \\
18+
13,200 & 1,200 & 6,867,000 & 503 & 5.342 & 821 \\
19+
13,500 & 1,350 & 6,935,000 & 508 & 5.376 & 815 \\
20+
\hline
21+
\end{tabular}
22+
23+
2700-1:
24+
\begin{tabular}{|l|l|l|l|l|l|}
25+
\hline Deck Width (mm) & 'A' (mm) & Area (mm²) & $\mathrm{Wt} / 3,000 \mathrm{~mm}$ (Kn) & Ix (m^) & Yt (mm) \\
26+
8,400 & 0 & 5,471,000 & 401 & 5.368 & 1,021 \\
27+
8,700 & 150 & 5,539,000 & 405 & 5.423 & 1,010 \\
28+
9,000 & 300 & 5,606,000 & 410 & 5.477 & 999 \\
29+
9,300 & 450 & 5,674,000 & 415 & 5.530 & 989 \\
30+
9,600 & 600 & 5,741,000 & 420 & 5.581 & 978 \\
31+
9,900 & 750 & 5,809,000 & 425 & 5.632 & 968 \\
32+
10,200 & 900 & 5,876,000 & 430 & 5.681 & 958 \\
33+
10,500 & 1,050 & 5,944,000 & 435 & 5.729 & 949 \\
34+
10,800 & 1,200 & 6,011,000 & 440 & 5.776 & 939 \\
35+
11,100 & 1,350 & 6,079,000 & 445 & 5.822 & 930 \\
36+
11,400 & 1,500 & 6,146,000 & 450 & 5.867 & 921 \\
37+
\hline
38+
\end{tabular}
39+
"""
40+
def test_asbi():
41+
42+
# Flat soffit
43+
shape = create_asbi("SS-1800-1", mesher="gmsh")
44+
u = shape.units
45+
assert shape.area == pytest.approx(3_920_000*u.mm**2, rel=2e-2)
46+
47+
shape = create_asbi("SS-1800-1+150", mesher="gmsh")
48+
u = shape.units
49+
assert shape.area == pytest.approx(3_988_000*u.mm**2, rel=2e-2)
50+
51+
shape = create_asbi("SS-1800-2+150", mesher="gmsh")
52+
u = shape.units
53+
assert shape.area == pytest.approx(5_032_000*u.mm**2, rel=2e-2)
54+
55+
56+
# Raised soffit
57+
shape = create_asbi("BC-1800-1", mesher="gmsh")
58+
u = shape.units
59+
assert shape.area == pytest.approx(4_687_000*u.mm**2, rel=1e-2)
60+
61+
shape = create_asbi("BC-1800-2", mesher="gmsh")
62+
u = shape.units
63+
assert shape.area == pytest.approx(5_805_000*u.mm**2, rel=1e-2)
64+
65+
66+
shape = create_asbi("BC-2100-1", mesher="gmsh")
67+
u = shape.units
68+
assert shape.area == pytest.approx(4_916_000*u.mm**2, rel=1e-2)
69+
70+
shape = create_asbi("BC-2100-1+900", mesher="gmsh")
71+
u = shape.units
72+
assert shape.area == pytest.approx(5_321_000*u.mm**2, rel=1e-2)
73+
74+
shape = create_asbi("BC-2100-1+1500", mesher="gmsh")
75+
u = shape.units
76+
assert shape.area == pytest.approx(5_591_000*u.mm**2, rel=1e-2)
77+
78+
shape = create_asbi("BC-2700-1", mesher="gmsh")
79+
u = shape.units
80+
assert shape.area == pytest.approx(5_471_000*u.mm**2, rel=1e-2)
81+
82+
shape = create_asbi("BC-3000-1+750", mesher="gmsh")
83+
u = shape.units
84+
assert shape.area == pytest.approx(6_135_000*u.mm**2, rel=1e-2)
85+
86+
87+
def test_torsion():
88+
89+
shape = load_shape("G02", mesh_type="T6", mesh_scale=1)
90+
91+
sv = SaintVenantSectionAnalysis(shape)
92+
assert sv.twist_rigidity()/shape.material["G"] == pytest.approx(42.487, rel=1e-1)
93+
94+
# shape = shape.translate(-sv.twist_center())
95+
# assert shape.cww()[0,0]/shape.material["E"] == pytest.approx(62.788, rel=2e-1)
96+
97+
tr = sv.create_trace(form="energetic")
98+
ky, kz = tr.sce()
99+
assert ky == pytest.approx(0.5993, rel=1e-3)
100+
assert kz == pytest.approx(0.2311, rel=1e-2)

0 commit comments

Comments
 (0)