-
Notifications
You must be signed in to change notification settings - Fork 50
feat: EC2 2023 8.1-Bending #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-ec2-2023
Are you sure you want to change the base?
feat: EC2 2023 8.1-Bending #120
Conversation
Co-authored-by: talledodiego <38036285+talledodiego@users.noreply.github.com>
…codes into ec_2004_crack_control
mortenengen
left a comment
There was a problem hiding this 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.
talledodiego
left a comment
There was a problem hiding this 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.
| 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') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
|
I’ve reviewed all of Diego’s comments and updated the tests accordingly, now coverage is at 100%. I also merged the changes from |
talledodiego
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
| ed_min = max(h / 30, 20) / 1000 | |
| ed_min = e_min(h) |
| 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') |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo fix
| 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. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
I have implemented and tested the formulas from the Eurocode 2:2023 '8.1-Bending with or without axial force'