Skip to content

Commit

Permalink
feat: concrete material properties and material class for Eurocode 2,…
Browse files Browse the repository at this point in the history
… 2004 (#77)

* Start implementing material properties for concrete ec2 2004

* Add eps_cu1 and eps_c2

* Add eps_cu2, n, eps_c3 and eps_cu3

* Add concrete implementation of concrete for EC2 2004

* Add EC2 to design code factory

* Add tests for concrete ec2 2004

* Move ec2 2004 tests into new structure

* Update units and docstrings

* Change name of function for calculating n

* Force absolute values for args

* Add fun for calc fcd

* Fix incorrect docstring
  • Loading branch information
mortenengen authored May 16, 2024
1 parent cd6bb81 commit 72e8978
Show file tree
Hide file tree
Showing 7 changed files with 1,067 additions and 3 deletions.
2 changes: 1 addition & 1 deletion structuralcodes/codes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# Design code registry
_DESIGN_CODES = {
'mc2010': mc2010,
'ec2_2023': ec2_2023,
'ec2_2004': ec2_2004,
'ec2_2023': ec2_2023,
}


Expand Down
28 changes: 28 additions & 0 deletions structuralcodes/codes/ec2_2004/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

import typing as t

from ._concrete_material_properties import (
Ecm,
eps_c1,
eps_c2,
eps_c3,
eps_cu1,
eps_cu2,
eps_cu3,
fcd,
fcm,
fctk_5,
fctk_95,
fctm,
n_parabolic_rectangular,
)
from ._reinforcement_material_properties import (
fyd,
reinforcement_duct_props,
Expand Down Expand Up @@ -59,6 +74,19 @@
'w_spacing',
'wk',
'xi1',
'fcd',
'fcm',
'fctm',
'fctk_5',
'fctk_95',
'Ecm',
'eps_c1',
'eps_cu1',
'eps_c2',
'eps_cu2',
'n_parabolic_rectangular',
'eps_c3',
'eps_cu3',
'fyd',
]

Expand Down
220 changes: 220 additions & 0 deletions structuralcodes/codes/ec2_2004/_concrete_material_properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
"""Concrete material properties according to Tab. 3.1."""

import math

from structuralcodes.codes import mc2010


def fcm(fck: float, delta_f: float = 8) -> float:
"""The mean compressive strength of concrete.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Keyword Args:
delta_f (float): The difference between the mean and the
characteristic strength.
Returns:
float: The mean compressive strength in MPa.
"""
return mc2010.fcm(fck=abs(fck), delta_f=abs(delta_f))


def fctm(fck: float) -> float:
"""The mean tensile strength of concrete.
EN 1992-1-1: 2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The mean tensile strength in MPa.
"""
return mc2010.fctm(fck=abs(fck))


def fctk_5(_fctm: float) -> float:
"""The 5% fractile of the tensile strength of concrete.
EN 1992-1-1: 2004, Table 3.1.
Args:
_fctm (float): The mean tensile strength of concrete in MPa.
Returns:
float: The 5% fractile of the tensile strength in MPa.
"""
return mc2010.fctkmin(_fctm=abs(_fctm))


def fctk_95(_fctm: float) -> float:
"""The 95% fractile of the tensile strength of concrete.
EN 1992-1-1: 2004, Table 3.1.
Args:
_fctm (float): The mean tensile strength of concrete in MPa.
Returns:
float: The 95% fractile of the tensile strength in MPa.
"""
return mc2010.fctkmax(_fctm=abs(_fctm))


def Ecm(_fcm: float) -> float:
"""The secant modulus of concrete.
EN 1992-1-1:2004, Table 3.1.
Args:
_fcm (float): The mean compressive strength of concrete in MPa.
Returns:
float: The secant modulus of concrete in MPa.
"""
return 22000.0 * math.pow(abs(_fcm) / 10, 0.3)


def eps_c1(_fcm: float) -> float:
"""The strain at maximum compressive stress of concrete (fcm) for the
Sargin constitutive law.
EN 1992-1-1:2004, Table 3.1.
Args:
_fcm (float): The mean compressive strength of concrete in MPa.
Returns:
float: The strain at maximum compressive stress, absolute value, no
unit.
"""
return min(0.7 * math.pow(abs(_fcm), 0.31), 2.8) / 1000


def eps_cu1(fck: float) -> float:
"""The ultimate strain for the Sargin constitutive law.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The ultimate strain, absolute value, no unit.
"""
fck = abs(fck)
return (
3.5 / 1000
if fck < 50
else (2.8 + 27 * ((98 - fcm(fck)) / 100) ** 4) / 1000
)


def eps_c2(fck: float) -> float:
"""The strain at maximum compressive stress of concrete for the
parabolic-rectangular law.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The strain at maximum compressive stress, absolute value, no
unit.
"""
fck = abs(fck)
return (
2.0 / 1000 if fck < 50 else (2.0 + 0.085 * (fck - 50) ** 0.53) / 1000
)


def eps_cu2(fck: float) -> float:
"""The ultimate strain of the parabolic-rectangular law.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The ultimate strain, absolute value, no unit.
"""
fck = abs(fck)
return (
3.5 / 1000 if fck < 50 else (2.6 + 35 * ((90 - fck) / 100) ** 4) / 1000
)


def n_parabolic_rectangular(fck: float) -> float:
"""The exponent in the parabolic-rectangular law.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The exponent n, absolute value, no unit.
"""
fck = abs(fck)
return 2.0 if fck < 50 else (1.4 + 23.4 * ((90 - fck) / 100) ** 4)


def eps_c3(fck: float) -> float:
"""The strain at maximum compressive stress of the bi-linear law.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The strain at maximum compressive stress, absolute value, no
unit.
"""
fck = abs(fck)
return 1.75 / 1000 if fck < 50 else (1.75 + 0.55 * (fck - 50) / 40) / 1000


def eps_cu3(fck: float) -> float:
"""The ultimate strain of the bi-linear law.
EN 1992-1-1:2004, Table 3.1.
Args:
fck (float): The characteristic compressive strength of concrete in
MPa.
Returns:
float: The ultimate strain, absolute value, no unit.
"""
return eps_cu2(fck)


def fcd(fck: float, alpha_cc: float, gamma_c: float) -> float:
"""The design compressive strength of concrete.
EN 1992-1-1:2004, Eq. (3.15)
Args:
fck (float): The characteristic compressive strength in MPa.
alpha_cc (float): A factor for considering long-term effects on the
strength, and effects that arise from the way the load is applied.
gamma_c (float): The partial factor of concrete.
Returns:
float: The design compressive strength of concrete in MPa
"""
return abs(alpha_cc) * abs(fck) / abs(gamma_c)
15 changes: 13 additions & 2 deletions structuralcodes/materials/concrete/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from structuralcodes.codes import _use_design_code

from ._concrete import Concrete
from ._concreteEC2_2004 import ConcreteEC2_2004
from ._concreteEC2_2023 import ConcreteEC2_2023
from ._concreteMC2010 import ConcreteMC2010

Expand All @@ -13,8 +14,15 @@
'Concrete',
'ConcreteMC2010',
'ConcreteEC2_2023',
'ConcreteEC2_2004',
]

CONCRETES: t.Dict[str, Concrete] = {
'fib Model Code 2010': ConcreteMC2010,
'EUROCODE 2 1992-1-1:2004': ConcreteEC2_2004,
'EUROCODE 2 1992-1-1:2023': ConcreteEC2_2023,
}


def create_concrete(
fck: float,
Expand Down Expand Up @@ -59,6 +67,9 @@ def create_concrete(
)

# Create the proper concrete object
if code.__title__ == 'fib Model Code 2010':
return ConcreteMC2010(fck, name, density, existing)
current_concrete = CONCRETES.get(code.__title__, None)
if current_concrete is not None:
return current_concrete(
fck=fck, name=name, density=density, existing=existing
)
return None
Loading

0 comments on commit 72e8978

Please sign in to comment.