From f358d1a98cb643b899554db7a9ee287e9ab9e124 Mon Sep 17 00:00:00 2001 From: reigt <73249392+reigt@users.noreply.github.com> Date: Wed, 7 Jan 2026 09:36:40 +0100 Subject: [PATCH 1/6] Init function for strain difference --- ...cracking_restraint_imposed_deformations.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py diff --git a/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py b/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py new file mode 100644 index 00000000..d2a64564 --- /dev/null +++ b/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py @@ -0,0 +1,37 @@ +"""Collection of functions from EUROCODE 1992-3:2006.""" + + +def eps_sm_eps_cm_m1( + alpha_e: float, + rho_p_eff: float, + kc: float, + k: float, + fct_eff: float, + Es: float, +) -> float: + """Returns the strain difference (epsilon_sm - epsilon_cm) needed to + compute the crack width for restraint member at its end according + to equation M.1. + + Args: + alpha_e (float): Is the ratio Es/Ecm. + rho_p_eff (float): Effective bond ratio between areas given by Eq. + (7.10). + kc (float): is a coefficient which takes account of the stress + distribution within the section immediately prior to cracking and + the change of the lever arm. + k (float): is the coefficient which allow for the effect of + non-uniform self-equilibrating stresses, which lead to a + reduction of restraint forces. + k=1 for webs w<=300mm or flanges widths less than 300mm + k=0.65 for webs w>=800mm or flanges with widths greater than 800mm + Intermediate values may be interpolated. + fct_eff (float): Is the mean value of the tensile strength in MPa of + the concrete effective at the time when the cracks may first be + expected to occur: fct_eff=fctm or fctm(t) if crack is expected + earlier than 28 days. + Es (float): Steel elastic modulus in MPa. + """ + return ( + 0.5 * alpha_e * kc * k * fct_eff * (1 + 1 / (alpha_e * rho_p_eff)) / Es + ) From 1f57b9b5a347777fce81717eaedef343b9027bec Mon Sep 17 00:00:00 2001 From: reigt <73249392+reigt@users.noreply.github.com> Date: Wed, 7 Jan 2026 09:37:15 +0100 Subject: [PATCH 2/6] Add to public API --- structuralcodes/codes/ec2_2004/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/structuralcodes/codes/ec2_2004/__init__.py b/structuralcodes/codes/ec2_2004/__init__.py index 08723763..1cfe3802 100644 --- a/structuralcodes/codes/ec2_2004/__init__.py +++ b/structuralcodes/codes/ec2_2004/__init__.py @@ -45,6 +45,7 @@ k_sargin, n_parabolic_rectangular, ) +from ._cracking_restraint_imposed_deformations import eps_sm_eps_cm_m1 from ._reinforcement_material_properties import ( epsud, fyd, @@ -94,6 +95,7 @@ 'Asw_s_required', 'alpha_e', 'eps_sm_eps_cm', + 'eps_sm_eps_cm_m1', 'hc_eff', 'k', 'k1', From 8744e0b708e225835ab2a0ca1538ae53f90160b9 Mon Sep 17 00:00:00 2001 From: reigt <73249392+reigt@users.noreply.github.com> Date: Wed, 7 Jan 2026 09:37:30 +0100 Subject: [PATCH 3/6] Add tests --- ...racking_restrained_imposed_deformations.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py diff --git a/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py b/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py new file mode 100644 index 00000000..1cb38912 --- /dev/null +++ b/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py @@ -0,0 +1,32 @@ +"""Tests for EUROCODE 1992-3:2006.""" + +import math + +import pytest + +from structuralcodes.codes.ec2_2004 import ( + _cracking_restraint_imposed_deformations, +) + + +@pytest.mark.parametrize( + 'alpha_e, rho_p_eff, kc, k, fct_eff, Es, expected', + [ + (5.869, 0.01478, 1, 1, 3.2, 200000, 0.000590), + (5.869, 0.009690, 1, 1, 3.2, 200000, 0.000875), + (5.512, 0.01478, 1, 1, 3.8, 200000, 0.000694), + (5.512, 0.009690, 1, 1, 3.8, 200000, 0.001032), + ], +) +def test_eps_sm_eps_cm_m1_returns_expected_values( + alpha_e, kc, k, fct_eff, rho_p_eff, Es, expected +): + """Test that eps_sm_cm_m1 returns expected values.""" + # Assert + assert math.isclose( + _cracking_restraint_imposed_deformations.eps_sm_eps_cm_m1( + alpha_e, rho_p_eff, kc, k, fct_eff, Es + ), + expected, + abs_tol=10e-5, + ) From 666f8f922e715666806bd9a95b09d4962d3d5767 Mon Sep 17 00:00:00 2001 From: reigt <73249392+reigt@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:29:20 +0100 Subject: [PATCH 4/6] Rename to eps_sm_eps_cm_restraint_end --- structuralcodes/codes/ec2_2004/__init__.py | 6 ++++-- .../ec2_2004/_cracking_restraint_imposed_deformations.py | 2 +- ...est_ec2_2004_cracking_restrained_imposed_deformations.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/structuralcodes/codes/ec2_2004/__init__.py b/structuralcodes/codes/ec2_2004/__init__.py index 1cfe3802..9f767bd9 100644 --- a/structuralcodes/codes/ec2_2004/__init__.py +++ b/structuralcodes/codes/ec2_2004/__init__.py @@ -45,7 +45,9 @@ k_sargin, n_parabolic_rectangular, ) -from ._cracking_restraint_imposed_deformations import eps_sm_eps_cm_m1 +from ._cracking_restraint_imposed_deformations import ( + eps_sm_eps_cm_restraint_end, +) from ._reinforcement_material_properties import ( epsud, fyd, @@ -95,7 +97,7 @@ 'Asw_s_required', 'alpha_e', 'eps_sm_eps_cm', - 'eps_sm_eps_cm_m1', + 'eps_sm_eps_cm_restraint_end', 'hc_eff', 'k', 'k1', diff --git a/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py b/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py index d2a64564..540ef019 100644 --- a/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py +++ b/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py @@ -1,7 +1,7 @@ """Collection of functions from EUROCODE 1992-3:2006.""" -def eps_sm_eps_cm_m1( +def eps_sm_eps_cm_restraint_end( alpha_e: float, rho_p_eff: float, kc: float, diff --git a/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py b/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py index 1cb38912..50db6975 100644 --- a/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py +++ b/tests/test_ec2_2004/test_ec2_2004_cracking_restrained_imposed_deformations.py @@ -24,7 +24,7 @@ def test_eps_sm_eps_cm_m1_returns_expected_values( """Test that eps_sm_cm_m1 returns expected values.""" # Assert assert math.isclose( - _cracking_restraint_imposed_deformations.eps_sm_eps_cm_m1( + _cracking_restraint_imposed_deformations.eps_sm_eps_cm_restraint_end( alpha_e, rho_p_eff, kc, k, fct_eff, Es ), expected, From cf76d773ae17b876bce32d73774416165322d025 Mon Sep 17 00:00:00 2001 From: Morten Engen Date: Thu, 8 Jan 2026 12:01:49 +0100 Subject: [PATCH 5/6] Update docstring with equation reference and type of returns --- .../ec2_2004/_cracking_restraint_imposed_deformations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py b/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py index 540ef019..20607e7c 100644 --- a/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py +++ b/structuralcodes/codes/ec2_2004/_cracking_restraint_imposed_deformations.py @@ -10,8 +10,9 @@ def eps_sm_eps_cm_restraint_end( Es: float, ) -> float: """Returns the strain difference (epsilon_sm - epsilon_cm) needed to - compute the crack width for restraint member at its end according - to equation M.1. + compute the crack width for restraint member at its end. + + EN 1992-3:2006, Eq. (M.1). Args: alpha_e (float): Is the ratio Es/Ecm. @@ -31,6 +32,9 @@ def eps_sm_eps_cm_restraint_end( expected to occur: fct_eff=fctm or fctm(t) if crack is expected earlier than 28 days. Es (float): Steel elastic modulus in MPa. + + Returns: + float: The calculated strain difference. """ return ( 0.5 * alpha_e * kc * k * fct_eff * (1 + 1 / (alpha_e * rho_p_eff)) / Es From 41c521110f825c639df0ae5a50af1c5cb7d9857e Mon Sep 17 00:00:00 2001 From: Morten Engen Date: Thu, 8 Jan 2026 12:02:01 +0100 Subject: [PATCH 6/6] Add entry in api docs --- docs/api/codes/ec2_2004/cracks.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/codes/ec2_2004/cracks.md b/docs/api/codes/ec2_2004/cracks.md index 3b081f66..5806064c 100644 --- a/docs/api/codes/ec2_2004/cracks.md +++ b/docs/api/codes/ec2_2004/cracks.md @@ -104,3 +104,9 @@ The following functions are related to calculating crack widths. ```{eval-rst} .. autofunction:: structuralcodes.codes.ec2_2004.As_min_2 ``` + +## Crack widths due to restraint of imposed deformations + +```{eval-rst} +.. autofunction:: structuralcodes.codes.ec2_2004.eps_sm_eps_cm_restraint_end +```