Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2e70179
Draft initial structure for the concrete class
mortenengen Dec 13, 2022
b8f67bb
Update docstring of base material
mortenengen Dec 13, 2022
c299dcc
minimum reinforcement areas functions
DanielGMorenaFhecor Dec 15, 2022
59a04f5
raise ValueError test functions for min area
DanielGMorenaFhecor Dec 27, 2022
b7167aa
crack_min_steel_without_direct_calculation
DanielGMorenaFhecor Jan 12, 2023
7189d31
Commit
DanielGMorenaFhecor Jan 12, 2023
4a0fcfb
crack without direct calculation tests
DanielGMorenaFhecor Jan 12, 2023
84c0140
adjusted bond strength
DanielGMorenaFhecor Jan 12, 2023
e0f1baa
hc_eff_concrete_tension formulation and testing
DanielGMorenaFhecor Jan 12, 2023
f2cbb49
requiremets.txt updated
DanielGMorenaFhecor Jan 12, 2023
333dcbe
rho_p_eff
DanielGMorenaFhecor Jan 12, 2023
59f1198
kt load duration
DanielGMorenaFhecor Jan 12, 2023
34d85d2
strain diff formula
DanielGMorenaFhecor Jan 12, 2023
a8ab129
chapter completed
DanielGMorenaFhecor Jan 13, 2023
ce4e432
imports and renamed functions
DanielGMorenaFhecor Jan 13, 2023
938c0f5
removed duplicate file
DanielGMorenaFhecor Jan 13, 2023
6ba6dc9
removed testing file
DanielGMorenaFhecor Jan 13, 2023
a9c9263
test renaming and docstring corrections
DanielGMorenaFhecor Jan 16, 2023
50c65b7
pull from upstream
DanielGMorenaFhecor Feb 8, 2023
ea3552b
Merge branch 'dev' of https://github.com/fib-international/structural…
DanielGMorenaFhecor Mar 9, 2023
4fd8b7e
230309 requested changes applied
DanielGMorenaFhecor Mar 9, 2023
1cffa61
small lint fixes
DanielGMorenaFhecor Mar 9, 2023
b483d40
vscode config updated
DanielGMorenaFhecor Mar 9, 2023
e9d953d
Merge branch 'dev' of https://github.com/fib-international/structural…
DanielGMorenaFhecor May 26, 2023
182e538
Merge branch 'dev' of https://github.com/fib-international/structural…
DanielGMorenaFhecor Dec 18, 2023
e509fb9
Merge branch 'dev' of https://github.com/fib-international/structural…
DanielGMorenaFhecor Mar 4, 2024
d57f945
Merge branch 'dev' of https://github.com/fib-international/structural…
DanielGMorenaFhecor Apr 4, 2024
bc049e4
Merge branch 'dev' of https://github.com/DanielGMorenaFhecor/structur…
DanielGMorenaFhecor Jul 30, 2024
04181e5
torsion completed
DanielGMorenaFhecor Aug 2, 2024
e66401a
Merge branch 'dev' into ec2_2023-8.3
mortenengen Oct 17, 2024
03d1245
Fix docstrings
mortenengen Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions structuralcodes/codes/ec2_2023/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,22 @@
wk_cal,
wk_cal2,
)
from ._section_8_3_torsion import (
VEd_i,
tau_t_i,
tau_t_rd,
tau_t_rd_max,
tau_t_rd_sl,
tau_t_rd_sw,
)

__all__ = [
'tau_t_rd_max',
'tau_t_rd',
'tau_t_rd_sl',
'tau_t_rd_sw',
'tau_t_i',
'VEd_i',
'A_phi_correction_exp',
'alpha_c_th',
'alpha_s_th',
Expand Down
214 changes: 214 additions & 0 deletions structuralcodes/codes/ec2_2023/_section_8_3_torsion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
"""Functions from Section 8.3 of EN 1992-1-1:2023."""

from typing import List


def tau_t_i(TEd: float, Ak: float, teff_i: float) -> float:
"""Calculate the torsional shear stress in a wall element.

EN1992-1-1:2023 Eq. (8.79).

Args:
TEd (float): Torsional moment applied to the section in kNm.
Ak (float): Area enclosed by the center-lines of the connecting walls,
including inner hollow areas in mm2.
teff_i (float): Effective wall thickness. It may be taken as A/u, but
should not be taken as less than twice the distance between the
outer concrete surface and the center of the longitudinal
reinforcement in mm.

Returns:
float: Torsional shear stress in i-wall in MPa.

Raises:
ValueError: If any of the input values Ak or teff_i are not positive.
"""
if Ak <= 0:
raise ValueError(f'Ak must be positive. Got {Ak}')
if teff_i <= 0:
raise ValueError(f'teff_i must be positive. Got {teff_i}')

return TEd * 1e6 / (2 * Ak * teff_i)


def VEd_i(tau_t_i: float, teff_i: float, zi: float) -> float:
"""Calculate the shear force in a wall element due to torsion.

EN1992-1-1:2023 Eq. (8.80).

Args:
tau_t_i (float): Torsional shear stress in i-wall in MPa.
teff_i (float): Effective wall thickness in mm.
zi (float): Lever arm of i-wall element in mm.

Returns:
float: Shear force in wall element i due to torsion in kN.

Raises:
ValueError: If any of the input values are not positive.
"""
if teff_i <= 0:
raise ValueError(f'teff_i must be positive. Got {teff_i}')
if zi <= 0:
raise ValueError(f'zi must be positive. Got {zi}')

return tau_t_i * teff_i * zi / 1000


def tau_t_rd_sw(
Asw: float,
fywd: float,
teff: float,
s: float,
cot_theta: float,
cot_theta_min: float,
) -> float:
"""Calculate the torsional capacity governed by yielding of the shear
reinforcement.

EN1992-1-1:2023 Eq. (8.82), (8.85).

Args:
Asw (float): Cross-sectional area of the shear reinforcement in mm2.
fywd (float): Design yield stress of the shear reinforcement in MPa.
teff (float): Effective wall thickness in mm.
s (float): Spacing between the shear reinforcement in mm.
theta (float): Cotangent of the angle of compression field with respect
to the longitudinal axis.
cot_theta_min (float): Limit value for the cotangent.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "defined in 8.2.3(4)"?


Returns:
float: Torsional capacity in MPa.

Raises:
ValueError: If any of the input values are non-positive.
"""
if Asw < 0:
raise ValueError(f'Asw should not be negative. Got {Asw}')
if fywd < 0:
raise ValueError(f'fywd should not be negative. Got {fywd}')
if teff < 0:
raise ValueError(f'teff should not be negative. Got {teff}')
cot_theta = max(1 / cot_theta_min, min(cot_theta, cot_theta_min))
return cot_theta * Asw / (teff * s) * fywd


def tau_t_rd_sl(
Asl: List[float],
fyd: List[float],
Comment on lines +97 to +98
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support only a plain a list or anything that is array-like? I am good with both, I am just thinking about similar implementations in otherparts of the code. Probably we should seek some uniformity?

teff: float,
uk: float,
cot_theta: float,
cot_theta_min: float,
) -> float:
"""Calculate the torsional capacity governed by yielding of the
longitudinal reinforcement.

EN1992-1-1:2023 Eq. (8.83), (8.85).

Args:
Asl (float): List of cross-sectional areas of the longitudinal
reinforcement in mm2.
fyd (float): List of design yield stresses of the longitudinal
reinforcement in MPa.
teff (float): Effective wall thickness in mm.
uk (float): Perimeter of the area in mm.
cot_theta (float): Cotangent of the angle of compression field with
respect to the longitudinal axis.
cot_theta_min (float): Limit value for the cotangent.

Returns:
float: Torsional capacity in MPa.

Raises:
ValueError: If any of the input values are non-positive.
"""
if len(Asl) != len(fyd):
raise ValueError('Length of Asl and fyd should be the same.')
for a in Asl:
if a < 0:
raise ValueError(f'Asl should not be negative. Got {a}')
for f in fyd:
if f < 0:
raise ValueError(f'fyd should not be negative. Got {f}')
if uk < 0:
raise ValueError(f'uk should not be negative. Got {uk}')
if teff < 0:
raise ValueError(f'teff should not be negative. Got {teff}')

sum_r = 0
n = len(Asl)
for i in range(n):
sum_r += Asl[i] * fyd[i]
Comment on lines +140 to +142
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it more pythonic (but maybe it is simply my preference):

for a, f in zip(Asl, fyd):
    sum_r += a * f


cot_theta = max(1 / cot_theta_min, min(cot_theta, cot_theta_min))
return sum_r / (teff * uk * cot_theta)


def tau_t_rd_max(
nu: float, fcd: float, cot_theta: float, cot_theta_min: float
) -> float:
"""Calculate the torsional capacity governed by crushing of the compression
field in concrete.

EN1992-1-1:2023 Eq. (8.84), (8.85).

Args:
nu (float): Coefficient as determined by the formulae in Annex G.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add: 'a value of nu = 0.6 may be used when cot_theta = 1.0'?

fcd (float): Design value of concrete compressive strength in MPa.
cot_theta (float): Cotangent Angle of compression field with respect to
the longitudinal axis.
cot_theta_min (float): Limit value for the cotangent.

Returns:
float: Torsional capacity in MPa.

Raises:
ValueError: If any of the input values are non-positive.
"""
if nu < 0:
raise ValueError(f'nu should not be negative. Got {nu}')
if fcd < 0:
raise ValueError(f'fcd should not be negative. Got {fcd}')

cot_theta = max(1 / cot_theta_min, min(cot_theta, cot_theta_min))
tan_theta = 1 / cot_theta
return nu * fcd / (cot_theta + tan_theta)


def tau_t_rd(
tau_t_rd_sw: float, tau_t_rd_sl: float, tau_t_rd_max: float
) -> float:
"""Calculate the design torsional capacity for a single cell or thin-walled
section.

EN1992-1-1:2023 Eq. (8.81).

Args:
tau_t_rd_sw (float): Torsional capacity governed by yielding of the
shear reinforcement in MPa.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "computed by eq. (8.82)"?

tau_t_rd_sl (float): Torsional capacity governed by yielding of the
longitudinal reinforcement in MPa.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "computed by eq. (8.83)"?

tau_t_rd_max (float): Torsional capacity governed by crushing of the
compression field in concrete in MPa.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "computed by eq. (8.84)"?


Returns:
float: Design torsional capacity in MPa.

Raises:
ValueError: If any of the input values are non-positive.
"""
if tau_t_rd_sw < 0:
raise ValueError(
f'tau_t_rd_sw should not be negative. Got {tau_t_rd_sw}'
)
if tau_t_rd_sl < 0:
raise ValueError(
f'tau_t_rd_sl should not be negative. Got {tau_t_rd_sl}'
)
if tau_t_rd_max < 0:
raise ValueError(
f'tau_t_rd_sl should not be negative. Got {tau_t_rd_max}'
)

return min(tau_t_rd_sw, tau_t_rd_sl, tau_t_rd_max)
Loading