Skip to content

Conversation

@DanielGMorenaFhecor
Copy link
Collaborator

I have implemented and tested the formulas from the Eurocode 2:2023 '8.1-Bending with or without axial force'

mortenengen and others added 30 commits December 13, 2022 21:01
Co-authored-by: talledodiego <38036285+talledodiego@users.noreply.github.com>
@DanielGMorenaFhecor DanielGMorenaFhecor added enhancement New feature or request EC2 2023 Eurocode 2 (2023) labels Jul 31, 2024
@DanielGMorenaFhecor DanielGMorenaFhecor self-assigned this Jul 31, 2024
@DanielGMorenaFhecor DanielGMorenaFhecor linked an issue Jul 31, 2024 that may be closed by this pull request
1 task
@mortenengen mortenengen removed this from the EC2 2023: Ultimate limit state milestone Jul 31, 2024
@mortenengen mortenengen self-requested a review July 31, 2024 19:28
@mortenengen mortenengen changed the title EC2 2023 8.1-Bending feat: EC2 2023 8.1-Bending Jul 31, 2024
@mortenengen mortenengen changed the base branch from dev to dev-ec2-2023 October 10, 2024 19:29
Copy link
Member

@mortenengen mortenengen left a comment

Choose a reason for hiding this comment

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

Thanks for the good contribution! I have merged dev and fixed the docstrings.

There are however a significant number of lines that are not covered by tests. Please add tests so we reach 100% coverage on this contribution.

Copy link
Collaborator

@talledodiego talledodiego left a comment

Choose a reason for hiding this comment

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

Well done! some minor comments in addition to @mortenengen 's request on improving test coverage.

Comment on lines 96 to 121
def sigma_cd(fcd: float, eps_c: float) -> float:
"""Computes the stress distribution in the compression zones.

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

Computes the scress distribution in the cmpressiopn zones (compressive
shown as positive).

Args:
fcd (float): Compressive design resistance of concrete (MPa).
eps_c (float): Strain value of concrete (non dimensional).

Returns:
float: Concrete stress in MPa.

Raises:
ValueError: If strain greater than eps_c_u=0.0035.
"""
if eps_c <= 0:
return 0.0
if eps_c <= 0.002:
return fcd * (1 - (1 - eps_c / 0.002) ** 2)
if eps_c <= 0.0035:
return fcd

raise ValueError('Strain cannot be greater than eps_c_u=0.0035')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed? Don't we have this already in the constitutive laws?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right, but for the sake of clarity, should we consider applying a one to one mapping between the original normative and the codebase? @mortenengen

Copy link
Collaborator

Choose a reason for hiding this comment

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

In my opinion it is an un-necessary duplication of code since this is already somewhere and could lead confusion to users? When they would / should use this function? Anyhow I see the point in keeping it also here for a 1:1 mapping. @mortenengen what is your idea here?

@DanielGMorenaFhecor
Copy link
Collaborator Author

DanielGMorenaFhecor commented May 21, 2025

I’ve reviewed all of Diego’s comments and updated the tests accordingly, now coverage is at 100%. I also merged the changes from dev.
Thanks for your time!

@mortenengen mortenengen moved this from Changes requested to Review changes in EC2 2023 PR tracker Sep 17, 2025
Copy link
Collaborator

@talledodiego talledodiego left a comment

Choose a reason for hiding this comment

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

thanks for the corrections. Still a couple of points present (mainly small typos?)

Returns:
float: minimum design moment in kNm.
"""
ed_min = max(h / 30, 20) / 1000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here can we use the new function e_min?

Suggested change
ed_min = max(h / 30, 20) / 1000
ed_min = e_min(h)

Comment on lines 96 to 121
def sigma_cd(fcd: float, eps_c: float) -> float:
"""Computes the stress distribution in the compression zones.

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

Computes the scress distribution in the cmpressiopn zones (compressive
shown as positive).

Args:
fcd (float): Compressive design resistance of concrete (MPa).
eps_c (float): Strain value of concrete (non dimensional).

Returns:
float: Concrete stress in MPa.

Raises:
ValueError: If strain greater than eps_c_u=0.0035.
"""
if eps_c <= 0:
return 0.0
if eps_c <= 0.002:
return fcd * (1 - (1 - eps_c / 0.002) ** 2)
if eps_c <= 0.0035:
return fcd

raise ValueError('Strain cannot be greater than eps_c_u=0.0035')
Copy link
Collaborator

Choose a reason for hiding this comment

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

In my opinion it is an un-necessary duplication of code since this is already somewhere and could lead confusion to users? When they would / should use this function? Anyhow I see the point in keeping it also here for a 1:1 mapping. @mortenengen what is your idea here?

EN1992-1-1:2023 Eq. (8.9 and 8.10).

Args:
sigma_c2d (float): the absolute alue of the minum principal
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo fix

Suggested change
sigma_c2d (float): the absolute alue of the minum principal
sigma_c2d (float): the absolute value of the minum principal

reinforcement in y direction in mm2.
f_yd (float): Yield strength of reinforcement in MPa.
b_csy (float): Width of the confinement core in mm.
x_cs (float): Width of the confinement core in mm.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the neural axis depth? Why it is assumed that it is in x direction?

Returns:
float: The effectiveness factor kconf_b.
"""
b_i = np.atleast_1d(b_i)
Copy link
Collaborator

Choose a reason for hiding this comment

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

check if any b_i is < 0 like in kconf_b_bending?

@talledodiego talledodiego moved this from Review changes to Changes requested in EC2 2023 PR tracker Oct 21, 2025
@talledodiego talledodiego moved this from Changes requested to Review changes in EC2 2023 PR tracker Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EC2 2023 Eurocode 2 (2023) enhancement New feature or request

Projects

Status: Review changes
Status: Under review 👀

Development

Successfully merging this pull request may close these issues.

EC2 2023: Bending with or without axial force

3 participants