diff --git a/eurocodedesign/standard/ec3/buckling/__init__.py b/eurocodedesign/standard/ec3/buckling/__init__.py index c4d6198..e489815 100644 --- a/eurocodedesign/standard/ec3/buckling/__init__.py +++ b/eurocodedesign/standard/ec3/buckling/__init__.py @@ -23,20 +23,20 @@ def get_alpha(buckling_line: BucklingLine) -> float: return _imperfection_value[buckling_line] -def _calc_Phi(bar_lambda: float, buckling_line: BucklingLine) -> float: +def _Phi(bar_lambda: float, buckling_line: BucklingLine) -> float: # according to EC3-1-1 6.3.1.2 alpha: float = get_alpha(buckling_line) Phi: float = 0.5 * (1 + alpha * (bar_lambda - 0.2) + bar_lambda ** 2) return Phi -def calc_chi(bar_lambda: float, buckling_line: BucklingLine) -> float: +def chi(bar_lambda: float, buckling_line: BucklingLine) -> float: # according to EC3-1-1 6.3.1.2 bar lambda relative slenderness chi: float if bar_lambda <= 0.2: chi = 1.0 else: # bar_lambda > 0.2 - Phi: float = _calc_Phi(bar_lambda, buckling_line) + Phi: float = _Phi(bar_lambda, buckling_line) chi = 1 / (Phi + np.sqrt(Phi ** 2 - bar_lambda ** 2)) chi = min(chi, 1.0) return chi diff --git a/eurocodedesign/standard/ec3/crosssection/classification.py b/eurocodedesign/standard/ec3/crosssection/classification.py index cdfc530..049e5ab 100644 --- a/eurocodedesign/standard/ec3/crosssection/classification.py +++ b/eurocodedesign/standard/ec3/crosssection/classification.py @@ -22,7 +22,7 @@ from eurocodedesign.materials.structuralsteel import BasicStructuralSteel -def calc_epsilon(f_yk: Pascal) -> float: +def epsilon(f_yk: Pascal) -> float: """Calculates the material specific epsilon factor Args: @@ -35,7 +35,7 @@ def calc_epsilon(f_yk: Pascal) -> float: return sqrt(235*MPa / f_yk) -def calc_k_sigma(psi: float, comp_free_edge: bool = True) -> float: +def k_sigma(psi: float, comp_free_edge: bool = True) -> float: if comp_free_edge: return 0.57 - 0.21 * psi + 0.07 * psi ** 2 @@ -69,7 +69,7 @@ def ct_limits_dsup_elements(f_yk: Pascal, alpha: float, psi: float) -> Dict[ def ct_limit_dsup_element_class_1(f_yk: Pascal, alpha: float) -> float: - eps = calc_epsilon(f_yk) + eps = epsilon(f_yk) if alpha <= 0.5: return 36 * eps / alpha else: @@ -77,7 +77,7 @@ def ct_limit_dsup_element_class_1(f_yk: Pascal, alpha: float) -> float: def ct_limit_dsup_element_class_2(f_yk: Pascal, alpha: float) -> float: - eps = calc_epsilon(f_yk) + eps = epsilon(f_yk) if alpha <= 0.5: return 41.5 * eps / alpha else: @@ -85,7 +85,7 @@ def ct_limit_dsup_element_class_2(f_yk: Pascal, alpha: float) -> float: def ct_limit_dsup_element_class_3(f_yk: Pascal, psi: float) -> float: - eps = calc_epsilon(f_yk) + eps = epsilon(f_yk) if psi <= -1: return 62 * eps * (1 - psi) * sqrt(-psi) else: @@ -128,43 +128,43 @@ def ct_limits_ssup_elements( def ct_limit_ssup_element_class_1(f_yk: Pascal, alpha: float) -> float: - return 9 * calc_epsilon(f_yk) / alpha + return 9 * epsilon(f_yk) / alpha def ct_limit_ssup_element_class_1_tension_free_edge( f_yk: Pascal, alpha: float ) -> float: - return 9 * calc_epsilon(f_yk) / (alpha * sqrt(alpha)) + return 9 * epsilon(f_yk) / (alpha * sqrt(alpha)) def ct_limit_ssup_element_class_2(f_yk: Pascal, alpha: float) -> float: - return 10 * calc_epsilon(f_yk) / alpha + return 10 * epsilon(f_yk) / alpha def ct_limit_ssup_element_class_2_tension_free_edge( f_yk: Pascal, alpha: float ) -> float: - return 10 * calc_epsilon(f_yk) / (alpha * sqrt(alpha)) + return 10 * epsilon(f_yk) / (alpha * sqrt(alpha)) def ct_limit_ssup_element_class_3(f_yk: Pascal, psi: float) -> float: if psi == 1.0: - return 14 * calc_epsilon(f_yk) + return 14 * epsilon(f_yk) - return 21 * calc_epsilon(f_yk) * sqrt(calc_k_sigma(psi)) + return 21 * epsilon(f_yk) * sqrt(k_sigma(psi)) def ct_limit_ssup_element_class_3_tension_free_edge(f_yk: Pascal, psi: float) -> float: - return 21 * calc_epsilon(f_yk) * sqrt( - calc_k_sigma(psi, comp_free_edge=False)) + return 21 * epsilon(f_yk) * sqrt( + k_sigma(psi, comp_free_edge=False)) def classify_angle_cross_section(h: Meter, b: Meter, t: Meter, f_yk: Pascal) -> int: slenderness = h / t slenderess_2 = (b + h) / (2 * t) - eps = calc_epsilon(f_yk) + eps = epsilon(f_yk) limit_one = 15 * eps limit_two = 11.5 * eps @@ -188,7 +188,7 @@ def classify_chs_cross_section(d: Meter, t: Meter, f_yk: Pascal) -> int: def ct_limits_chs_elements(f_yk: Pascal) -> Dict[int, float]: - eps = calc_epsilon(f_yk) + eps = epsilon(f_yk) ct_limits = { 1: 50 * eps ** 2, 2: 70 * eps ** 2, @@ -210,14 +210,14 @@ def classify_rolled_i_section( " minor axis bending is not supported" ) - ct_vals = calc_i_section_cts( + ct_vals = i_section_cts( section.h*mm, section.b*mm, section.r*mm, section.t_w*mm, section.t_f*mm, ) # "Meter" required because units are not yet implemented for sections. - + web_class = classify_i_section_web( section, material, ct_vals["web"][0], ct_vals["web"][1], N_Ed, M_Ed_y) flange_class = classify_ssup_element(ct_vals["flange"][0], @@ -233,16 +233,16 @@ def classify_i_section_web(section: RolledISection, N_Ed: Newton | None = None, M_Ed_y: Newtonmeter | None = None ) -> int: - + if not isinstance(N_Ed, Newton) and not isinstance(M_Ed_y, Newtonmeter): alpha_web: float = 1.0 psi_web: float = 1.0 elif not isinstance(N_Ed, Newton) and isinstance(M_Ed_y, Newtonmeter): - alpha_web = calc_alpha_i_section_web( + alpha_web = alpha_i_section_web( c, t, material.f_yk, Newton(0) ) - psi_web = calc_psi_i_section_web( + psi_web = psi_i_section_web( section.A*mm2, section.W_ely*mm3, Newton(0), @@ -250,16 +250,16 @@ def classify_i_section_web(section: RolledISection, ) elif isinstance(N_Ed, Newton) and not isinstance(M_Ed_y, Newtonmeter): - + try: - alpha_web = calc_alpha_i_section_web(c, t, material.f_yk, N_Ed) - + alpha_web = alpha_i_section_web(c, t, material.f_yk, N_Ed) + except ValueError as e: if not str(e) == "Tension demand larger than web capacity.": raise ValueError(e) return 1 # because web is in tension it is class 1 - psi_web = calc_psi_i_section_web( + psi_web = psi_i_section_web( section.A*mm2, section.W_ely*mm3, N_Ed, Newtonmeter(0) ) @@ -267,14 +267,14 @@ def classify_i_section_web(section: RolledISection, elif isinstance(N_Ed, Newton) and isinstance(M_Ed_y, Newtonmeter): try: - alpha_web = calc_alpha_i_section_web(c, t, material.f_yk, N_Ed) - + alpha_web = alpha_i_section_web(c, t, material.f_yk, N_Ed) + except ValueError as e: if not str(e) == "Tension demand larger than web capacity.": raise ValueError(e) return 1 # because web is in tension it is class 1 - - psi_web = calc_psi_i_section_web( + + psi_web = psi_i_section_web( section.A*mm2, section.W_ely*mm3, N_Ed, M_Ed_y ) @@ -286,7 +286,7 @@ def classify_i_section_web(section: RolledISection, -def calc_i_section_cts( +def i_section_cts( h: Meter, b: Meter, weld_or_radius: Meter, @@ -300,7 +300,7 @@ def calc_i_section_cts( return {"flange": [c_flange, t_f], "web": [c_web, t_w]} -def calc_alpha_i_section_web(c: Meter, t: Meter, f_yk: Pascal, +def alpha_i_section_web(c: Meter, t: Meter, f_yk: Pascal, N_Ed: Newton) -> float: e = abs(N_Ed) / (t * f_yk) if N_Ed < 0.0: @@ -314,7 +314,7 @@ def calc_alpha_i_section_web(c: Meter, t: Meter, f_yk: Pascal, return alpha -def calc_psi_i_section_web( +def psi_i_section_web( A: Meter_2, W_ely: Meter_3, N_Ed: Newton, M_Ed_y: Newtonmeter ) -> float: if N_Ed == 0 and M_Ed_y == 0: diff --git a/eurocodedesign/standard/ec3/platebuckling/effective_width_method.py b/eurocodedesign/standard/ec3/platebuckling/effective_width_method.py index fb78845..d5b428c 100644 --- a/eurocodedesign/standard/ec3/platebuckling/effective_width_method.py +++ b/eurocodedesign/standard/ec3/platebuckling/effective_width_method.py @@ -22,13 +22,13 @@ import eurocodedesign.standard.ec3 as ec3 from eurocodedesign.standard.ec3 import platebuckling, buckling # noqa: F401 from eurocodedesign.standard.ec3.crosssection.classification import \ - calc_epsilon + epsilon from eurocodedesign.standard.ec3.platebuckling import PlateSupport, \ PlateStiffeners @singledispatch -def calc_bar_lambda_p(*args: Any) -> float: +def bar_lambda_p(*args: Any) -> float: r"""Calculate modified slenderness for plate buckling Calculation according to EN 1993-1-5:2019-10 §4.4(2) @@ -46,19 +46,19 @@ def calc_bar_lambda_p(*args: Any) -> float: see also EN 1993-1-1:2010-12 Tab. 5.2 t: plate thickness :math:`t` epsilon: epsilon factor :math:`\epsilon`, see - ec3.crosssection.classification.calc_epsilon + ec3.crosssection.classification.epsilon k_sigmap: plate buckling factor :math:`k_{\sigma,p}`, - see calc_k_sigmap + see k_sigmap Returns: Relative slenderness :math:`\bar{\lambda}_p` for plate buckling """ - raise NotImplementedError(f"calc_bar_lambda_p not supported for " + raise NotImplementedError(f"bar_lambda_p not supported for " f"argument type {type(args)}") -@calc_bar_lambda_p.register -def _calc_bar_lambda_p_f_y(f_y: Pascal, sigma_crp: Pascal) -> float: +@bar_lambda_p.register +def _bar_lambda_p_f_y(f_y: Pascal, sigma_crp: Pascal) -> float: r"""Calculate modified slenderness for plate buckling Calculation according to EN 1993-1-5:2019-10 §4.4(2) @@ -74,8 +74,8 @@ def _calc_bar_lambda_p_f_y(f_y: Pascal, sigma_crp: Pascal) -> float: return bar_lambda_p -@calc_bar_lambda_p.register -def _calc_bar_lambda_p_bar_b(bar_b: Meter, +@bar_lambda_p.register +def _bar_lambda_p_bar_b(bar_b: Meter, t: Meter, epsilon: float, k_sigmap: float) -> float: @@ -88,8 +88,8 @@ def _calc_bar_lambda_p_bar_b(bar_b: Meter, see also EN 1993-1-1:2010-12 Tab. 5.2 t: Plate thickness :math:`t` epsilon: Epsilon factor :math:`\epsilon`, see - ec3.crosssection.classification.calc_epsilon - k_sigmap: plate buckling factor :math:`k_{\sigma,p}`, see calc_k_sigmap + ec3.crosssection.classification.epsilon + k_sigmap: plate buckling factor :math:`k_{\sigma,p}`, see k_sigmap Returns: Relative plate slenderness :math:`\bar{\lambda}_p` @@ -98,7 +98,7 @@ def _calc_bar_lambda_p_bar_b(bar_b: Meter, return bar_lambda_p -def calc_rho_p(support: PlateSupport, +def rho_p(support: PlateSupport, bar_lambda_p: float, psi: float = 1.0) -> float: r"""Calculates the reduction factor :math:`\rho_p` for plate buckling @@ -111,7 +111,7 @@ def calc_rho_p(support: PlateSupport, Args: support: PlateSupport.ONE_SIDE or PlateSupport.TWO_SIDE bar_lambda_p: relative slenderness :math:`\bar{\lambda}_p` for - plate buckling, see calc_bar_lambda_p + plate buckling, see bar_lambda_p psi: stress ratio :math:`\psi` Returns: @@ -136,7 +136,7 @@ def calc_rho_p(support: PlateSupport, return rho_p -def calc_k_sigmap(psi: float, support: PlateSupport) -> float: +def k_sigmap(psi: float, support: PlateSupport) -> float: r"""Calculate plate buckling factor for two-side supported plate One-side supported plate not supported. @@ -151,7 +151,7 @@ def calc_k_sigmap(psi: float, support: PlateSupport) -> float: """ if support != PlateSupport.TWO_SIDE: - raise NotImplementedError("calc_k_sigmap only supported for two-side" + raise NotImplementedError("k_sigmap only supported for two-side" " supported plates") k_sigmap: float if psi == 1.0: @@ -167,7 +167,7 @@ def calc_k_sigmap(psi: float, support: PlateSupport) -> float: return k_sigmap -def calc_sigma_E(t: Meter, +def sigma_E(t: Meter, b: Meter) -> Pascal: r"""Calculate maximum elastic stress value :math:`\sigma_E` for the plate @@ -185,15 +185,15 @@ def calc_sigma_E(t: Meter, return sigma_E -def calc_sigma_crp(k_sigmap: float, sigma_E: Pascal) -> Pascal: +def sigma_crp(k_sigmap: float, sigma_E: Pascal) -> Pascal: r"""Calculate critical stress :math:`\sigma_{cr,p}` for plate buckling Calculation according to EN 1993-1-5:2019-10 §A.1(2) with E = 21_000 kN/cm² and v = 0,3 Args: - k_sigmap: plate buckling factor :math:`k_\sigma`, see calc_k_sigmap - sigma_E: maximum elastic stress :math:`\sigma_E`, see calc_sigma_E + k_sigmap: plate buckling factor :math:`k_\sigma`, see k_sigmap + sigma_E: maximum elastic stress :math:`\sigma_E`, see sigma_E Returns: critical stress :math:`\sigma_{cr,p}` for plate buckling @@ -202,7 +202,7 @@ def calc_sigma_crp(k_sigmap: float, sigma_E: Pascal) -> Pascal: return sigma_crp -def calc_effective_width(support: PlateSupport, +def effective_width(support: PlateSupport, bar_b: Meter, rho_p: float, psi: float) -> MeterTriple: @@ -214,14 +214,14 @@ def calc_effective_width(support: PlateSupport, Args: bar_b: Decisive width :math:`\bar{b}` - rho_p: reduction factor :math:`\rho` for plate buckling, see calc_rho_p + rho_p: reduction factor :math:`\rho` for plate buckling, see rho_p psi: stress ratio :math:`\psi = \sigma_2 / \sigma_1` Returns: Effective plate widths :math:`(b_{eff}, b_{e1}, b_{e2})` """ if support != PlateSupport.TWO_SIDE: - raise NotImplementedError("calc_effective_width only implemented for" + raise NotImplementedError("effective_width only implemented for" "two-side supported plates") b_eff: Meter b_e1: Meter @@ -240,7 +240,7 @@ def calc_effective_width(support: PlateSupport, return b_eff, b_e1, b_e2 -def calc_sigma_crc(t: Meter, +def sigma_crc(t: Meter, a: Meter) -> Pascal: r"""Calculate critical stress value :math:`\sigma_{cr,c}` @@ -257,11 +257,11 @@ def calc_sigma_crc(t: Meter, :math:`\sigma_{cr,c}` """ - sigma_crc: Pascal = calc_sigma_E(t, a) + sigma_crc: Pascal = sigma_E(t, a) return sigma_crc -def calc_bar_lambda_c(f_y: Pascal, sigma_crc: Pascal) -> float: +def bar_lambda_c(f_y: Pascal, sigma_crc: Pascal) -> float: r"""Calculate the relative slenderness for flexural flange buckling Calculation according to EN 1993-1-5:2019-10 §4.5.3(4) @@ -269,7 +269,7 @@ def calc_bar_lambda_c(f_y: Pascal, sigma_crc: Pascal) -> float: Args: f_y: yield stress :math:`f_y` sigma_crc: critical stress :math:`\sigma_{cr,c}` - for flexural flange buckling, see calc_sigma_crc + for flexural flange buckling, see sigma_crc Returns: relative slenderness for flexural flange buckling :math:`\bar{\lambda_c}` @@ -279,7 +279,7 @@ def calc_bar_lambda_c(f_y: Pascal, sigma_crc: Pascal) -> float: return bar_lambda_c -def calc_chi_c(stiffeners: PlateStiffeners, +def chi_c(stiffeners: PlateStiffeners, bar_lambda_c: float) -> float: r"""Calculate the reduction factor :math:`\chi_c` for lateral buckling-like behavior @@ -297,15 +297,15 @@ def calc_chi_c(stiffeners: PlateStiffeners, """ if stiffeners != PlateStiffeners.NONE: - raise NotImplementedError("calc_chi_c only implemented " + raise NotImplementedError("chi_c only implemented " "for unstiffened plates") - chi_c: float = ec3.buckling.calc_chi(bar_lambda_c, + chi_c: float = ec3.buckling.chi(bar_lambda_c, ec3.buckling.BucklingLine.a) return chi_c -def calc_xi(sigma_crp: Pascal, sigma_crc: Pascal) -> float: +def xi(sigma_crp: Pascal, sigma_crc: Pascal) -> float: r""" Calculate the interaction factor :math:`\xi` between plate and flange buckling @@ -324,7 +324,7 @@ def calc_xi(sigma_crp: Pascal, sigma_crc: Pascal) -> float: return xi -def calc_rho_c(rho_p: float, chi_c: float, +def rho_c(rho_p: float, chi_c: float, xi: float) -> float: r"""Calculate reduction factor :math:`\rho_c` @@ -334,10 +334,10 @@ def calc_rho_c(rho_p: float, chi_c: float, Args: rho_p: reduction factor :math:`\rho_p` for plate buckling, - see calc_rho_p + see rho_p chi_c: reduction factor :math:`\chi_c` for compression flange buckling, - see calc_chi_c - xi: interaction factor :math:`\xi`, see calc_xi + see chi_c + xi: interaction factor :math:`\xi`, see xi Returns: final reduction factor :math:`\rho_c` @@ -346,7 +346,7 @@ def calc_rho_c(rho_p: float, chi_c: float, return rho_c -def calc_eta_1(f_y: Pascal, +def eta_1(f_y: Pascal, N_Ed: Newton, A_eff: Meter_2, M_y_Ed: Newtonmeter = 0.0, @@ -408,15 +408,15 @@ def is_shear_buckling_verification_required(h_w: Meter, """ eta: float = platebuckling.get_eta(steel_grade) - epsilon: float = calc_epsilon(steel_grade.f_yk) + epsilon_: float = epsilon(steel_grade.f_yk) if stiffeners == PlateStiffeners.NONE: - return h_w / t_w > 72 / eta * epsilon + return h_w / t_w > 72 / eta * epsilon_ else: raise NotImplementedError("Not implemented for stiffened plates") -def calc_k_tau(h_w: Meter, a: Meter, stiffeners: PlateStiffeners) -> float: +def k_tau(h_w: Meter, a: Meter, stiffeners: PlateStiffeners) -> float: r"""Calculate shear plate buckling factor :math:`k_\tau` According to EN 1993-1-5:2019-10 §A.3(1) @@ -441,14 +441,14 @@ def calc_k_tau(h_w: Meter, a: Meter, stiffeners: PlateStiffeners) -> float: return k_tau -def calc_tau_cr(k_tau: float, sigma_E: Pascal) -> Pascal: +def tau_cr(k_tau: float, sigma_E: Pascal) -> Pascal: """Calculate :math:`\tau_{cr}` According to EN 1993-1-5:2019-10 §5.3(3) Args: - k_tau: shear plate buckling factor :math:`k_\tau`, see calc_k_tau - sigma_E: yield stress :math:`sigma_E`, see calc_sigma_E + k_tau: shear plate buckling factor :math:`k_\tau`, see k_tau + sigma_E: yield stress :math:`sigma_E`, see sigma_E Returns: Critical shear stress :math:`\tau_{cr}` @@ -457,7 +457,7 @@ def calc_tau_cr(k_tau: float, sigma_E: Pascal) -> Pascal: return tau_cr -def calc_bar_lambda_w(f_yw: Pascal, tau_cr: Pascal) -> float: +def bar_lambda_w(f_yw: Pascal, tau_cr: Pascal) -> float: r"""Calculate modified web slenderness :math:`\bar{\lambda}_w` According to EN 1993-1-5:2019-10 §5.3(3) @@ -475,7 +475,7 @@ def calc_bar_lambda_w(f_yw: Pascal, tau_cr: Pascal) -> float: return bar_lambda_w -def calc_chi_w(bar_lambda_w: float, +def chi_w(bar_lambda_w: float, steel_grade: BasicStructuralSteel, stiffeners: PlateStiffeners) -> float: r"""Calculate shear buckling reduction factor :math:`\chi_w` @@ -484,7 +484,7 @@ def calc_chi_w(bar_lambda_w: float, Args: bar_lambda_w: modified web slenderness :math:`\bar{\lambda}_w`, - see calc_bar_lambda_w() + see bar_lambda_w() steel_grade: mteel grade, see eurocodedesign.materials.strucuralsteel stiffeners: type of plate stiffening @@ -505,14 +505,14 @@ def calc_chi_w(bar_lambda_w: float, return chi_w -def calc_V_bw_Rd(chi_w: float, f_yw: Pascal, h_w: Meter, +def V_bw_Rd(chi_w: float, f_yw: Pascal, h_w: Meter, t_w: Meter) -> Newton: # 5.2 r"""Calculate design resistance :math:`V_{bw,Rd}` of the web According to EN 1993-1-5:2019-10 §5.2(1) Args: - chi_w: web reduction factor :math:`\chi_w`, see calc_chi_w() + chi_w: web reduction factor :math:`\chi_w`, see chi_w() f_yw: yield stress :math:`f_{yw}` of the web h_w: web height :math:`h_w` from flange to flange t_w: web thickness :math:`t_w` @@ -524,7 +524,7 @@ def calc_V_bw_Rd(chi_w: float, f_yw: Pascal, h_w: Meter, return V_bw_Rd -def calc_V_bf_Rd() -> NoReturn: +def V_bf_Rd() -> NoReturn: """Design resistance of shear buckling resistance of the flange According to EN 1993-1-5:2019-10 §5.4 @@ -535,7 +535,7 @@ def calc_V_bf_Rd() -> NoReturn: raise NotImplementedError -def calc_V_b_Rd(V_bw_Rd: Newton, +def V_b_Rd(V_bw_Rd: Newton, V_bf_Rd: Newton, steel_grade: BasicStructuralSteel, f_yw: Pascal, @@ -563,7 +563,7 @@ def calc_V_b_Rd(V_bw_Rd: Newton, return min(V_b_Rd, max_V_b_Rd) -def calc_eta_3(V_Ed: Pascal, V_b_Rd: Pascal) -> Eta: +def eta_3(V_Ed: Pascal, V_b_Rd: Pascal) -> Eta: r"""Calculate utilisation rate :math:`\eta_3` due to shear buckling According to EN 1993-1-5:2019-10 §5.5(1) diff --git a/eurocodedesign/standard/ec3/platebuckling/reduced_stress_method.py b/eurocodedesign/standard/ec3/platebuckling/reduced_stress_method.py index 572e9d9..37291bb 100644 --- a/eurocodedesign/standard/ec3/platebuckling/reduced_stress_method.py +++ b/eurocodedesign/standard/ec3/platebuckling/reduced_stress_method.py @@ -21,9 +21,9 @@ def is_permitted(rho: float, alpha_ultk: float, stepper: Stepper) -> bool: plates. Args: - rho: reduction factor :math:`\rho` from §10 (5), see calc_rho + rho: reduction factor :math:`\rho` from §10 (5), see rho alpha_ultk: minimum load amplifier :math:`\alpha_{ult,k}` of the design - loads, see calc_alpha_ultk + loads, see alpha_ultk stepper: Stepper object to which calculcation steps are added Returns: @@ -40,7 +40,7 @@ def is_permitted(rho: float, alpha_ultk: float, stepper: Stepper) -> bool: return valid -def calc_bar_lambda_p(alpha_ultk: float, +def bar_lambda_p(alpha_ultk: float, alpha_cr: float) -> float: r"""Calculate the plate slenderness :math:`\bar{\lambda}_p` of the plate buckling field according to EN 1993-1-5:2019-10 §10 (3) @@ -48,9 +48,9 @@ def calc_bar_lambda_p(alpha_ultk: float, Args: alpha_ultk: minimum load amplifier of the design loads to reach the characteristic resistance of the most critical cross-section, - see calc_alpha_ultk + see alpha_ultk alpha_cr: critical load factor for plate buckling - (minimum force amplifier), see calc_alpha_cr + (minimum force amplifier), see alpha_cr Returns: FloatSequence: The plate slenderness :math:`\bar{\lambda}_p``. @@ -60,7 +60,7 @@ def calc_bar_lambda_p(alpha_ultk: float, return bar_lambda_p -def calc_alpha_ultk(f_y: Pascal, +def alpha_ultk(f_y: Pascal, sigma_x_Ed: Pascal, sigma_z_Ed: Pascal, tau_Ed: Pascal) -> float: @@ -93,7 +93,7 @@ def calc_alpha_ultk(f_y: Pascal, return alpha_ultk -def calc_alpha_cr(alpha_crx: float, alpha_crz: float, alpha_crtau: float, +def alpha_cr(alpha_crx: float, alpha_crz: float, alpha_crtau: float, psi_x: float, psi_z: float) -> float: r"""Calculates :math:`\alpha_{cr}` from :math:`\sigma_{x,Ed}, \sigma_{z,Ed}, \tau_{Ed}` @@ -126,7 +126,7 @@ def calc_alpha_cr(alpha_crx: float, alpha_crz: float, alpha_crtau: float, return alpha_cr -def _calc_chi_w() -> NoReturn: +def _chi_w() -> NoReturn: r"""Calculate the reduction factor :math:`\chi_w` for shear buckling Calculation according to EN 1993-1-5:2019-10 §5.3(1). @@ -137,7 +137,7 @@ def _calc_chi_w() -> NoReturn: ReductionMethod = Literal['smallest', 'interpolate'] -def _calc_rho(support: PlateSupport, +def _rho(support: PlateSupport, bar_lambda_p: float, psi: float = 1.0) -> float: r"""Calculates the reduction factor :math:`\\rho` @@ -150,7 +150,7 @@ def _calc_rho(support: PlateSupport, Args: support: PlateSupport.ONE_SIDE or PlateSupport.TWO_SIDE bar_lambda_p: relative slenderness :math:`\bar{\lambda}_p` for - plate buckling, see calc_bar_lambda_p + plate buckling, see bar_lambda_p psi: stress ratio :math:`\psi` Returns: @@ -175,7 +175,7 @@ def _calc_rho(support: PlateSupport, return rho -def calc_rho(method: ReductionMethod, +def rho(method: ReductionMethod, support: PlateSupport, bar_lambda_p: float, psi_x: float, @@ -200,10 +200,10 @@ def calc_rho(method: ReductionMethod, FloatTriple: :math:`\rho_x, \rho_z, \chi_w` """ - rho_x: float = _calc_rho(support, bar_lambda_p, psi_x) + rho_x: float = _rho(support, bar_lambda_p, psi_x) # Note for rho_z, §6 is neglected, instead 4.5.4(1) is used - rho_z: float = _calc_rho(support, bar_lambda_p, psi_z) - # chi_w: float = _calc_chi_w() # Currently not supported + rho_z: float = _rho(support, bar_lambda_p, psi_z) + # chi_w: float = _chi_w() # Currently not supported chi_w: float = 1.0 if method == 'interpolate': @@ -214,7 +214,7 @@ def calc_rho(method: ReductionMethod, raise ValueError(f'Method {method} not supported.') -def calc_eta(f_y: Pascal, +def eta(f_y: Pascal, sigma_x_Ed: Pascal, sigma_z_Ed: Pascal, tau_Ed: Pascal, diff --git a/eurocodedesign/standard/ec3/steel_bridges/fatigue.py b/eurocodedesign/standard/ec3/steel_bridges/fatigue.py index 26b3478..06382d2 100644 --- a/eurocodedesign/standard/ec3/steel_bridges/fatigue.py +++ b/eurocodedesign/standard/ec3/steel_bridges/fatigue.py @@ -35,7 +35,7 @@ def gamma_Mf(country: NACountry = NACountry.NONE) -> NoReturn: " not implemented, yet.") -def calc_lambda_1(bridge_type: BridgeType, +def lambda_1(bridge_type: BridgeType, L: Meter, bridge_section: BridgeSection) -> float: r"""Calculate damage effect factor :math:`\lambda_1` of traffic @@ -73,7 +73,7 @@ def calc_lambda_1(bridge_type: BridgeType, return lambda_1 -def calc_lambda_2(bridge_type: BridgeType, +def lambda_2(bridge_type: BridgeType, Q_m1: Newton, N_Obs: int) -> float: r"""Calculate traffic volume factor :math:`\lambda_2` @@ -99,7 +99,7 @@ def calc_lambda_2(bridge_type: BridgeType, return lambda_2 -def calc_lambda_3(bridge_type: BridgeType, t_Ld: float) -> float: +def lambda_3(bridge_type: BridgeType, t_Ld: float) -> float: r"""Calculate bridge design life factor :math:`\lambda_3` According to EN 1993-2:2010-12 §9.5.2(3) @@ -121,7 +121,7 @@ def calc_lambda_3(bridge_type: BridgeType, t_Ld: float) -> float: @NDP -def calc_lambda_4(bridge_type: BridgeType, +def lambda_4(bridge_type: BridgeType, k: float, country: NACountry = '') -> float: r"""Calculate traffic on other lanes factor :math:`\lambda_4` @@ -143,7 +143,7 @@ def calc_lambda_4(bridge_type: BridgeType, raise NotImplementedError -def calc_lambda_max(bridge_type: BridgeType, +def lambda_max(bridge_type: BridgeType, L: Meter, bridge_section: BridgeSection) -> float: r"""Calculate maximum damage equivalence factor :math:`\lambda_{max}` @@ -179,7 +179,7 @@ def calc_lambda_max(bridge_type: BridgeType, return lambda_max -def calc_lambda(lambda_1: float, +def lambda(lambda_1: float, lambda_2: float, lambda_3: float, lambda_4: float, @@ -223,7 +223,7 @@ def get_Phi_2(bridge_type: BridgeType) -> float: raise NotImplementedError(f"Not implemented for {bridge_type}") -def calc_Delta_sigma_E2(lambda_: float, +def Delta_sigma_E2(lambda_: float, Phi_2: float, Delta_sigma_p: Pascal) -> Pascal: """ diff --git a/tests/standard/ec3/crosssection/test_crosssectionclassification.py b/tests/standard/ec3/crosssection/test_crosssectionclassification.py index fe95dad..57d4d54 100644 --- a/tests/standard/ec3/crosssection/test_crosssectionclassification.py +++ b/tests/standard/ec3/crosssection/test_crosssectionclassification.py @@ -122,7 +122,7 @@ def test_235MPa_pure_compression(self): def test_235MPa_bending_and_compression(self): actual = csc.ct_limits_dsup_elements(235*MPa, 0.3, -1.3) expected = {1: 120, 2: 138.3333333, 3: 162.5890156} - assert actual == approx(expected) + assert actual == approx(expected) class TestCtLimitsDsupElementClassOne: @@ -291,27 +291,27 @@ def test_355MPa_psi_neq_one(self): class TestCalcKsigma: def test_compression_free_edge(self): - actual = csc.calc_k_sigma(0.5) + actual = csc.k_sigma(0.5) expected = 0.4825 assert actual == approx(expected) def test_tension_free_edge_gt_zero(self): - actual = csc.calc_k_sigma(0.5, comp_free_edge=False) + actual = csc.k_sigma(0.5, comp_free_edge=False) expected = 0.6880952381 assert actual == approx(expected) def test_tension_free_edge_eq_zero(self): - actual = csc.calc_k_sigma(0.0, comp_free_edge=False) + actual = csc.k_sigma(0.0, comp_free_edge=False) expected = 1.7 assert actual == approx(expected) def test_tension_free_edge_eq_one(self): - actual = csc.calc_k_sigma(1.0, comp_free_edge=False) + actual = csc.k_sigma(1.0, comp_free_edge=False) expected = 0.43 assert actual == approx(expected) def test_tension_free_edge_eq_minus_one(self): - actual = csc.calc_k_sigma(-1, comp_free_edge=False) + actual = csc.k_sigma(-1, comp_free_edge=False) expected = 23.8 assert actual == approx(expected) @@ -431,7 +431,7 @@ def test_pure_tension_loading(self, ipe270, S235_thin_material): assert actual == expected def test_get_i_section_cts(): - actual = csc.calc_i_section_cts(300*mm, 150*mm, 15*mm, 8*mm, 12*mm) + actual = csc.i_section_cts(300*mm, 150*mm, 15*mm, 8*mm, 12*mm) # conversion of result to floats because unit module does not support # comparison with the approximate values used by pytest actual = {k: [v[0], v[1]] for k, v in @@ -445,49 +445,49 @@ def test_get_i_section_cts(): class TestCalcPsiISectionWeb: def test_positive_N_only(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, mm3, 5000*N, 0*Nm ) expected = 1 assert actual == expected def test_negative_N_only(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, 1000*mm3, -5000*N, 0*Nm ) expected = 1 assert actual == expected def test_positive_M_only(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, 1000*mm3, 0*N, 50*Nm ) expected = -1 assert actual == expected def test_negative_M_only(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, 1000*mm3, 0*N, -50*Nm ) expected = -1 assert actual == expected def test_positive_N_and_M(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, 1000*mm3, 5000*N, 75*Nm ) expected = -0.2 assert actual == approx(expected) def test_negative_N_and_positive_M(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, 1000*mm3, -5000*N, 75*Nm ) expected = -5 assert actual == approx(expected) def test_negative_N_and_negative_M(self): - actual = csc.calc_psi_i_section_web( + actual = csc.psi_i_section_web( 100*mm2, 1000*mm3, -5000*N, -75*Nm ) expected = -5 @@ -496,21 +496,21 @@ def test_negative_N_and_negative_M(self): class TestCalcAlphaISectionWeb: def test_positive_N(self): - actual = csc.calc_alpha_i_section_web( + actual = csc.alpha_i_section_web( 120*mm, 5*mm, 235*MPa, 100000*N ) expected = 0.8546099291 assert actual == approx(expected) def test_positive_N_gt_web_capacity(self): - actual = csc.calc_alpha_i_section_web( + actual = csc.alpha_i_section_web( 120*mm, 5*mm, 235*MPa, 10000000*N ) expected = 1 assert actual == approx(expected) def test_negative_N(self): - actual = csc.calc_alpha_i_section_web( + actual = csc.alpha_i_section_web( 120*mm, 5*mm, 235*MPa, -100000*N ) expected = 0.1453900709 diff --git a/tests/standard/ec3/platebuckling/test_effective_width_method.py b/tests/standard/ec3/platebuckling/test_effective_width_method.py index 574b206..9c25aa6 100644 --- a/tests/standard/ec3/platebuckling/test_effective_width_method.py +++ b/tests/standard/ec3/platebuckling/test_effective_width_method.py @@ -9,30 +9,30 @@ def test_longitudinal(): - assert (ewm.calc_k_sigmap(1.0, PlateSupport.TWO_SIDE) + assert (ewm.k_sigmap(1.0, PlateSupport.TWO_SIDE) == approx(4.0)) - assert (ewm.calc_bar_lambda_p(1000*mm, 10*mm, 0.81, 4.0) + assert (ewm.bar_lambda_p(1000*mm, 10*mm, 0.81, 4.0) == approx(2.17, 0.01)) - assert (ewm.calc_rho_p(PlateSupport.TWO_SIDE, 2.17, 1.0) + assert (ewm.rho_p(PlateSupport.TWO_SIDE, 2.17, 1.0) == approx(0.414, 0.001)) - assert isclose(ewm.calc_sigma_crp(4.0, 190000 * (10 / 1000) ** 2 + assert isclose(ewm.sigma_crp(4.0, 190000 * (10 / 1000) ** 2 *N/mm2), 76.00 *N/mm2) def test_buckling_like(): - assert isclose(ewm.calc_sigma_crc(10*mm, 600*mm), 52.7777777*N/mm2) - assert (ewm.calc_xi(109, 76) + assert isclose(ewm.sigma_crc(10*mm, 600*mm), 52.7777777*N/mm2) + assert (ewm.xi(109, 76) == approx(0.44, 0.02)) - assert (ewm.calc_bar_lambda_c(355 * N/mm2, 76 * N/mm2) + assert (ewm.bar_lambda_c(355 * N/mm2, 76 * N/mm2) == approx(2.16, 0.01)) - assert (ewm.calc_chi_c(PlateStiffeners.NONE, 2.16) + assert (ewm.chi_c(PlateStiffeners.NONE, 2.16) == approx(0.194, 0.01)) - assert (ewm.calc_rho_c(0.485, 0.194, 0.44) + assert (ewm.rho_c(0.485, 0.194, 0.44) == approx(0.394, 0.001)) - assert (ewm.calc_effective_width(PlateSupport.TWO_SIDE, 1000*mm, + assert (ewm.effective_width(PlateSupport.TWO_SIDE, 1000*mm, 0.32, 1) == (0.32*1000*mm, 0.5*0.32*1000*mm, .5*0.32*1000*mm)) - assert (ewm.calc_eta_1(S355().f_yk, + assert (ewm.eta_1(S355().f_yk, 90*N/mm2*42.7*cm2/0.327, 42.7*cm2) == approx(0.776, 0.01)) @@ -45,26 +45,26 @@ def test_shear_buckling(): S355(), PlateStiffeners.NONE) is True) - assert (ewm.calc_k_tau(1000*mm, 600*mm, PlateStiffeners.NONE) + assert (ewm.k_tau(1000*mm, 600*mm, PlateStiffeners.NONE) == approx(18.833, 0.01)) - assert isclose(ewm.calc_tau_cr(18.833, - ewm.calc_sigma_E(12*mm, + assert isclose(ewm.tau_cr(18.833, + ewm.sigma_E(12*mm, 1000*mm)), 515.270879*N/mm2) - assert (ewm.calc_bar_lambda_w(355*N/mm2, 515*N/mm2) + assert (ewm.bar_lambda_w(355*N/mm2, 515*N/mm2) == approx(0.631, 0.01)) - assert (ewm.calc_chi_w(0.631, S355(), PlateStiffeners.NONE) + assert (ewm.chi_w(0.631, S355(), PlateStiffeners.NONE) == approx(1.20)) - assert isclose(ewm.calc_V_bw_Rd(1.096, 355 * N/mm2, + assert isclose(ewm.V_bw_Rd(1.096, 355 * N/mm2, 1000*mm, 10*mm), 2246.354*kN) - assert isclose(ewm.calc_V_b_Rd(2000*kN, + assert isclose(ewm.V_b_Rd(2000*kN, 2000*kN, S355(), S355().f_yk, 1000*mm, 12*mm), 2951.4145760 * kN) - assert (ewm.calc_eta_3(700*kN, 2683*kN) + assert (ewm.eta_3(700*kN, 2683*kN) == approx(0.261, 0.01)) diff --git a/tests/standard/ec3/platebuckling/test_reduced_stress_method.py b/tests/standard/ec3/platebuckling/test_reduced_stress_method.py index e332aa2..5fe85fa 100644 --- a/tests/standard/ec3/platebuckling/test_reduced_stress_method.py +++ b/tests/standard/ec3/platebuckling/test_reduced_stress_method.py @@ -12,50 +12,50 @@ def test_is_permitted(): assert rsm.is_permitted(rho=0.8, alpha_ultk=1.0) is False -def test_calc_bar_lambda_p(): - assert rsm.calc_bar_lambda_p(alpha_ultk=1.392, +def test_bar_lambda_p(): + assert rsm.bar_lambda_p(alpha_ultk=1.392, alpha_cr=3.660) == approx(0.617, 0.001) -def test_calc_alpha_ultk(): - assert rsm.calc_alpha_ultk(f_y=355*MPa, +def test_alpha_ultk(): + assert rsm.alpha_ultk(f_y=355*MPa, sigma_x_Ed=245*MPa, sigma_z_Ed=0*MPa, tau_Ed=41*MPa) == approx(1.392, 0.001) -def test_calc_alpha_cr(): - assert rsm.calc_alpha_cr(alpha_crx=4.203, +def test_alpha_cr(): + assert rsm.alpha_cr(alpha_crx=4.203, alpha_crz=inf, alpha_crtau=10.178, psi_x=1.0, psi_z=0.0) == approx(3.660, 0.001) -def test_calc_rho(): +def test_rho(): bar_lambda_p = 0.994 with pytest.raises(TypeError) as excinfo: - rsm.calc_rho(method='interpolate', + rsm.rho(method='interpolate', support=None, bar_lambda_p=bar_lambda_p, psi_x=0.5, psi_z=-3) assert 'support must be an instance of Enum PlateSupport' \ in str(excinfo.value) - assert rsm.calc_rho(method='interpolate', + assert rsm.rho(method='interpolate', support=PlateSupport.TWO_SIDE, bar_lambda_p=bar_lambda_p, psi_x=0.5, psi_z=-3) == approx((0.811, 1.0, 1.0), 0.001) - assert rsm.calc_rho(method='smallest', + assert rsm.rho(method='smallest', support=PlateSupport.ONE_SIDE, bar_lambda_p=bar_lambda_p, psi_x=0.5, psi_z=-3) == approx((0.815, 0.815, 0.815), 0.001) -def test_calc_eta(): - assert rsm.calc_eta(f_y=355*MPa, +def test_eta(): + assert rsm.eta(f_y=355*MPa, sigma_x_Ed=-231*MPa, sigma_z_Ed=13.6*MPa, tau_Ed=75*MPa,