Skip to content
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

Set default values for delta parameters in form 4.2 from nen_en_1992_… #331

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def __init__(
self,
c_min_b: MM,
c_min_dur: MM,
delta_c_dur_gamma: MM,
delta_c_dur_st: MM,
delta_c_dur_add: MM,
delta_c_dur_gamma: MM = 0,
delta_c_dur_st: MM = 0,
delta_c_dur_add: MM = 0,
) -> None:
"""[:math:`c_{min}`] Calculates the minimum concrete cover [:math:`mm`].

Expand All @@ -35,10 +35,16 @@ def __init__(
[:math:`c_{min,dur}`] The minimum concrete cover based on environmental conditions based on art. 4.4.1.2 (5) [:math:`mm`].
delta_c_dur_gamma: MM
[:math:`Δc_{dur,γ}`] An additional safety requirement based on art. 4.4.1.2 (6) [:math:`mm`].
The value of [:math:`Δc_{dur,γ}`] for use in a Country may be found in its National Annex.
The recommended value is O mm. 0 mm is the default value in the formula if not specified otherwise.
delta_c_dur_st: MM
[:math:`Δc_{dur,st}`] A reduction of minimum concrete cover when using stainless steel based on art. 4.4.1.2 (7) [:math:`mm`].
The value of [:math:`Δc_{dur,st}`] for use in a Country may be found in its National Annex.
The recommended value, without further specification, is 0 mm. 0 mm is the default value in the formula if not specified otherwise.
delta_c_dur_add: MM
[:math:`Δc_{dur,add}`] A reduction of minimum concrete cover when using additional protection based on art. 4.4.1.2 (8) [:math:`mm`].
The value of [:math:`Δc_{dur,add}`] for use in a Country may be found in its National Annex.
The recommended value, without further specification, is 0 mm. 0 mm is the default value in the formula if not specified otherwise.
"""
super().__init__()
self.c_min_b = c_min_b
Expand All @@ -51,9 +57,9 @@ def __init__(
def _evaluate(
c_min_b: MM,
c_min_dur: MM,
delta_c_dur_gamma: MM,
delta_c_dur_st: MM,
delta_c_dur_add: MM,
delta_c_dur_gamma: MM = 0,
delta_c_dur_st: MM = 0,
delta_c_dur_add: MM = 0,
) -> MM:
"""For more detailed documentation see the class docstring."""
raise_if_negative(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ def test_evaluation(self) -> None:

assert form_4_2 == pytest.approx(expected=manually_calculated_result, rel=1e-4)

def test_evaluation_default_values(self) -> None:
"""Test the evaluation of the result using the default values for delta parameters."""
# Example values
c_min_b = 15 # mm
c_min_dur = 20 # mm
form_4_2 = Form4Dot2MinimumConcreteCover(
c_min_b=c_min_b,
c_min_dur=c_min_dur,
)

# Expected result, manually calculated
manually_calculated_result = 20

assert form_4_2 == pytest.approx(expected=manually_calculated_result, rel=1e-4)

def test_raise_error_when_negative_c_min_b_is_given(self) -> None:
"""Test the evaluation of the result."""
# Example values
Expand Down