feat: implement driver functions for shear formulas in EC2 2004#352
feat: implement driver functions for shear formulas in EC2 2004#352sanvik02 wants to merge 3 commits into
Conversation
| concretebounds = srf_geoms.polygon.bounds | ||
| h = concretebounds[3] - concretebounds[1] | ||
| bw = concretebounds[2] - concretebounds[0] |
There was a problem hiding this comment.
To make it slightly more explicit, consider rewriting to the following:
xmin, ymin, xmax, ymax = srf_geoms.polygon.bounds
h = ymax - ymin
bw = xmax - xmin| if abs(concretebounds[1] - bar.point.bounds[1]) < abs( | ||
| concretebounds[3] - bar.point.bounds[1] | ||
| ): |
There was a problem hiding this comment.
Ref. the comment above, this line could be written slightly more explicit as:
if abs(ymin - bar.point.y) < abs(ymax - bar.point.y):| for bar in reinf_bars: | ||
| avg_reinf_height += bar.point.bounds[1] | ||
| avg_reinf_height /= len(reinf_bars) |
There was a problem hiding this comment.
Consider simplifying this with a list comprehension:
avg_reinf_height = sum(bar.point.y for bar in reinf_bars) / len(reinf_bars)| for bar in reinf_bars: | ||
| avg_reinf_height += bar.point.bounds[1] | ||
| avg_reinf_height /= len(reinf_bars) | ||
| d = h + concretebounds[1] - avg_reinf_height |
There was a problem hiding this comment.
Ref. the first comment, please consider slightly rewriting:
d = h + ymin - avg_reinf_height| Asl = 0 | ||
| for bar in reinf_bars: | ||
| Asl += bar.area |
There was a problem hiding this comment.
Consider using a list comprehension here:
Asl = sum(bar.area for bar in reinf_bars)| design_value = VRdc( | ||
| fck, | ||
| d, | ||
| Asl, | ||
| bw, | ||
| NEd, | ||
| Ac, | ||
| fcd, | ||
| k1=k1, | ||
| gamma_c=gamma_c, | ||
| ) | ||
|
|
||
| max_allowable_shearforce = VEdmax_unreinf( | ||
| bw, | ||
| d, | ||
| fck, | ||
| fcd, | ||
| ) | ||
|
|
||
| return design_value, max_allowable_shearforce |
There was a problem hiding this comment.
Minor comment about naming. To guide the user with interpreting what is returned, please consider renaming the variables to e.g.:
shear_tension_capacity = VRdc(...)
shear_compression_capacity = VEdmax_unreinf(...)
return shear_tension_capacity, shear_compression_capacityAnd also use this wording in the description of the returns in the docstring.
| limit_fyd (bool): Flag to indicate if the design yield stress is | ||
| limited to 0.8 * fyk or not. This controls whether the stress | ||
| reduction factor of concrete is given by Eq. (6.6) (False) or | ||
| (6.10) (True). Default value is False. |
There was a problem hiding this comment.
Here we should also note that simply setting limit_fyd=True only influences the strength reduction factor of concrete when calculating the shear compression capacity. The actual limiting of the design yield strength of the stirrups is obtained by setting the correct values of gamma_s and fyk in the reinforcement material of the ShearReinforcement object that is passed to the function.
| concretebounds = srf_geoms.polygon.bounds | ||
| h = concretebounds[3] - concretebounds[1] | ||
| bw = concretebounds[2] - concretebounds[0] | ||
| # Assume tensile reinforcement is in the lower half of the section | ||
| reinf_bars = [] | ||
| for bar in section.geometry.point_geometries: | ||
| if abs(concretebounds[1] - bar.point.bounds[1]) < abs( | ||
| concretebounds[3] - bar.point.bounds[1] | ||
| ): | ||
| reinf_bars.append(bar) | ||
| # Calculate d as the average height of the tensile reinforcement | ||
| avg_reinf_height = 0 | ||
| for bar in reinf_bars: | ||
| avg_reinf_height += bar.point.bounds[1] | ||
| avg_reinf_height /= len(reinf_bars) | ||
| d = h + concretebounds[1] - avg_reinf_height | ||
| z = 0.9 * d | ||
|
|
||
| Ac = section.gross_properties.area | ||
| Asl = 0 | ||
| for bar in reinf_bars: | ||
| Asl += bar.area |
There was a problem hiding this comment.
Please consider the comments above, and since this code block is re-used several times, please consider factoring it out to a separate private function. The function call could be on the form:
bw, h, d, Ac, Asl = _calculate_geometry_props(geometry=section.geometry)| section: BeamSection, | ||
| material: ReinforcementEC2_2004, | ||
| VEd: float, | ||
| theta: float = 21.8, # Gir cot theta = 2.5 |
There was a problem hiding this comment.
Please remove the word "Gir".
| diameter: float = 10, | ||
| n: int = 2, |
There was a problem hiding this comment.
I think we should avoid providing default values for diameter and n.
| concretebounds = srf_geoms.polygon.bounds | ||
| h = concretebounds[3] - concretebounds[1] | ||
| # Assume tensile reinforcement is in the lower half of the section | ||
| reinf_bars = [] | ||
| for bar in section.geometry.point_geometries: | ||
| if abs(concretebounds[1] - bar.point.bounds[1]) < abs( | ||
| concretebounds[3] - bar.point.bounds[1] | ||
| ): | ||
| reinf_bars.append(bar) | ||
| # Calculate d as the average height of the tensile reinforcement | ||
| avg_reinf_height = 0 | ||
| for bar in reinf_bars: | ||
| avg_reinf_height += bar.point.bounds[1] | ||
| avg_reinf_height /= len(reinf_bars) | ||
| d = h + concretebounds[1] - avg_reinf_height | ||
| z = 0.9 * d |
There was a problem hiding this comment.
Same comment as above, please factor out to a separate private function.
| fctk_5 = srf_geoms.material.fctk_5 | ||
| fctd = alpha_ct * fctk_5 / gamma_c # Should be taken from concrete class |
There was a problem hiding this comment.
With the latest updates on the dev branch, these lines can be replaced with the following:
fctd = srf_geoms.material.fctd()There was a problem hiding this comment.
Please undo the changes in this file so that we can fix the public API in a separate PR after merging this PR 😃
mortenengen
left a comment
There was a problem hiding this comment.
Thanks for this very useful contribution! I have left a couple of comments for you to consider while finalizing.
@talledodiego do you have anything to add?
Implemented driver functions for the shear formulas in 6.2.2 and 6.2.3 in EC2 2004.