-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from Blueprints-org/11-feature-request-add-for…
…mulas-3_3_till_3_16 Add formulas 3.3 - 3.10 from 1992-1-1+C2:2011
- Loading branch information
Showing
15 changed files
with
1,196 additions
and
318 deletions.
There are no files selected for viewing
438 changes: 431 additions & 7 deletions
438
blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
KN = float | ||
MM2 = float | ||
MPA = float | ||
MM = float | ||
DAYS = float |
612 changes: 306 additions & 306 deletions
612
docs/source/codes/eurocode/ec2_1992_1_1_2011/equations.md
Large diffs are not rendered by default.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_10.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
"""Testing formula 3.10 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot10CoefficientAgeConcreteDryingShrinkage | ||
|
||
|
||
class TestForm3Dot10CoefficientAgeConcreteDryingShrinkage: | ||
"""Validation for formula 3.10 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
t = 10 # - | ||
t_s = 2 # - | ||
h_0 = 200 # - | ||
form_3_10 = Form3Dot10CoefficientAgeConcreteDryingShrinkage(t=t, t_s=t_s, h_0=h_0) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 0.06604088 | ||
|
||
assert form_3_10 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_t_is_given(self) -> None: | ||
"""Test a negative value.""" | ||
# Example values | ||
t = -10 # - | ||
t_s = 2 # - | ||
h_0 = 200 # - | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot10CoefficientAgeConcreteDryingShrinkage(t=t, t_s=t_s, h_0=h_0) | ||
|
||
def test_raise_error_when_negative_t_s_is_given(self) -> None: | ||
"""Test a negative value.""" | ||
# Example values | ||
t = 10 # - | ||
t_s = -2 # - | ||
h_0 = 200 # - | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot10CoefficientAgeConcreteDryingShrinkage(t=t, t_s=t_s, h_0=h_0) | ||
|
||
def test_raise_error_when_negative_h_0_is_given(self) -> None: | ||
"""Test a negative value.""" | ||
# Example values | ||
t = 10 # - | ||
t_s = 2 # - | ||
h_0 = -200 # - | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot10CoefficientAgeConcreteDryingShrinkage(t=t, t_s=t_s, h_0=h_0) | ||
|
||
def test_raise_error_when_t_is_smaller_than_t_s(self) -> None: | ||
"""Test a comparison.""" | ||
# Example values | ||
t = 10 # - | ||
t_s = 12 # - | ||
h_0 = 200 # - | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot10CoefficientAgeConcreteDryingShrinkage(t=t, t_s=t_s, h_0=h_0) |
28 changes: 28 additions & 0 deletions
28
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Testing formula 3.3 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot3AxialTensileStrengthFromTensileSplittingStrength | ||
|
||
|
||
class TestForm3Dot3AxialTensileStrengthFromTensileSplittingStrength: | ||
"""Validation for formula 3.3 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
f_ct_sp = 3.4 # MPa | ||
form_3_3 = Form3Dot3AxialTensileStrengthFromTensileSplittingStrength(f_ct_sp=f_ct_sp) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 3.06 | ||
|
||
assert form_3_3 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_f_ct_sp_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
f_ct_sp = -3.4 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot3AxialTensileStrengthFromTensileSplittingStrength(f_ct_sp=f_ct_sp) |
52 changes: 52 additions & 0 deletions
52
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_4.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Testing formula 3.4 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot4DevelopmentTensileStrength | ||
|
||
|
||
class TestForm3Dot4DevelopmentTensileStrength: | ||
"""Validation for formula 3.4 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
beta_cc_t = 0.32 # - | ||
alpha = 2 / 3 # - | ||
f_ctm = 3.45 # MPa | ||
form_3_4 = Form3Dot4DevelopmentTensileStrength(beta_cc_t=beta_cc_t, alpha=alpha, f_ctm=f_ctm) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 1.614058 | ||
|
||
assert form_3_4 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_alpha_is_given(self) -> None: | ||
"""Test that an error is raised when alpha is negative.""" | ||
# Example values | ||
beta_cc_t = 0.32 # -> Positive | ||
alpha = -0.4 # -> Negative | ||
f_ctm = 3.45 # MPa -> Positive | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot4DevelopmentTensileStrength(beta_cc_t=beta_cc_t, alpha=alpha, f_ctm=f_ctm) | ||
|
||
def test_raise_error_when_negative_beta_cc_t_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
beta_cc_t = -0.32 # - -> Negative | ||
alpha = 2 / 3 # - -> Equal to 1 or 2/3 | ||
f_ctm = 3.45 # MPa -> Positive | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot4DevelopmentTensileStrength(beta_cc_t=beta_cc_t, alpha=alpha, f_ctm=f_ctm) | ||
|
||
def test_raise_error_when_negative_f_ctm_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
beta_cc_t = 0.32 # - -> Positive | ||
alpha = 2 / 3 # - -> unequal to 1 or 2/3 | ||
f_ctm = -3.45 # MPa -> Negative | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot4DevelopmentTensileStrength(beta_cc_t=beta_cc_t, alpha=alpha, f_ctm=f_ctm) |
52 changes: 52 additions & 0 deletions
52
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_5.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Testing formula 3.5 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot5ApproximationVarianceElasticModulusOverTime | ||
|
||
|
||
class TestForm3Dot5ApproximationVarianceElasticModulusOverTime: | ||
"""Validation for formula 3.5 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
f_cm_t = 2.34 # MPa | ||
f_cm = 3.4 # MPa | ||
e_cm = 2.9 # MPa | ||
form_3_5 = Form3Dot5ApproximationVarianceElasticModulusOverTime(f_cm_t=f_cm_t, f_cm=f_cm, e_cm=e_cm) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 2.592502 | ||
|
||
assert form_3_5 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_f_cm_t_is_given(self) -> None: | ||
"""Test a negative value.""" | ||
# Example values | ||
f_cm_t = -2.34 # MPa | ||
f_cm = 3.4 # MPa | ||
e_cm = 2.9 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot5ApproximationVarianceElasticModulusOverTime(f_cm_t=f_cm_t, f_cm=f_cm, e_cm=e_cm) | ||
|
||
def test_raise_error_when_negative_f_cm_is_given(self) -> None: | ||
"""Test a negative value.""" | ||
# Example values | ||
f_cm_t = 2.34 # MPa | ||
f_cm = -3.4 # MPa | ||
e_cm = 2.9 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot5ApproximationVarianceElasticModulusOverTime(f_cm_t=f_cm_t, f_cm=f_cm, e_cm=e_cm) | ||
|
||
def test_raise_error_when_negative_e_cm_is_given(self) -> None: | ||
"""Test a negative value.""" | ||
# Example values | ||
f_cm_t = 2.34 # MPa | ||
f_cm = 3.4 # MPa | ||
e_cm = -2.9 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot5ApproximationVarianceElasticModulusOverTime(f_cm_t=f_cm_t, f_cm=f_cm, e_cm=e_cm) |
52 changes: 52 additions & 0 deletions
52
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_6.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Testing formula 3.6 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot6CreepDeformationOfConcrete | ||
|
||
|
||
class TestForm3Dot6CreepDeformationOfConcrete: | ||
"""Validation for formula 3.6 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = 0.34 # - | ||
sigma_c = 0.75 # MPa | ||
e_c = 2.45 # MPa | ||
form_3_6 = Form3Dot6CreepDeformationOfConcrete(phi_inf_t0=phi_inf_t0, sigma_c=sigma_c, e_c=e_c) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 0.1040816 | ||
|
||
assert form_3_6 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_phi_inf_t0_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = -0.34 # - | ||
sigma_c = 0.75 # MPa | ||
e_c = 2.45 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot6CreepDeformationOfConcrete(phi_inf_t0=phi_inf_t0, sigma_c=sigma_c, e_c=e_c) | ||
|
||
def test_raise_error_when_negative_sigma_c_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = 0.34 # - | ||
sigma_c = -0.75 # MPa | ||
e_c = 2.45 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot6CreepDeformationOfConcrete(phi_inf_t0=phi_inf_t0, sigma_c=sigma_c, e_c=e_c) | ||
|
||
def test_raise_error_when_negative_e_c_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = 0.34 # - | ||
sigma_c = 0.75 # MPa | ||
e_c = -2.45 # MPa | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot6CreepDeformationOfConcrete(phi_inf_t0=phi_inf_t0, sigma_c=sigma_c, e_c=e_c) |
39 changes: 39 additions & 0 deletions
39
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_7.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Testing formula 3.7 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot7NonLinearCreepCoefficient | ||
|
||
|
||
class TestForm3Dot7NonLinearCreepCoefficient: | ||
"""Validation for formula 3.7 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = 0.25 # - | ||
k_sigma = 2.47 # days | ||
form_3_7 = Form3Dot7NonLinearCreepCoefficient(phi_inf_t0=phi_inf_t0, k_sigma=k_sigma) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 5.174308 | ||
|
||
assert form_3_7 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_phi_inf_t0_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = -0.25 # - | ||
k_sigma = 2.47 # days | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot7NonLinearCreepCoefficient(phi_inf_t0=phi_inf_t0, k_sigma=k_sigma) | ||
|
||
def test_raise_error_when_negative_k_sigma_is_given(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
phi_inf_t0 = 0.25 # - | ||
k_sigma = -2.47 # days | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot7NonLinearCreepCoefficient(phi_inf_t0=phi_inf_t0, k_sigma=k_sigma) |
33 changes: 33 additions & 0 deletions
33
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_8.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Testing formula 3.8 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot8TotalShrinkage | ||
|
||
|
||
class TestForm3Dot8TotalShrinkage: | ||
"""Validation for formula 3.8 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
epsilon_cd = 0.25 # - | ||
epsilon_ca = 0.33 # - | ||
form_3_8 = Form3Dot8TotalShrinkage(epsilon_cd=epsilon_cd, epsilon_ca=epsilon_ca) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 0.58 | ||
|
||
assert form_3_8 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_evaluation_2(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
epsilon_cd = -0.25 # - | ||
epsilon_ca = 0.33 # - | ||
form_3_8 = Form3Dot8TotalShrinkage(epsilon_cd=epsilon_cd, epsilon_ca=epsilon_ca) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 0.08 | ||
|
||
assert form_3_8 == pytest.approx(expected=manually_calculated_result, rel=1e-4) |
42 changes: 42 additions & 0 deletions
42
tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_9.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Testing formula 3.9 of NEN-EN 1992-1-1+C2:2011.""" | ||
# pylint: disable=arguments-differ | ||
import pytest | ||
|
||
from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011.chapter_3_materials import Form3Dot9DryingShrinkage | ||
|
||
|
||
class TestForm3Dot9DryingShrinkage: | ||
"""Validation for formula 3.9 from NEN-EN 1992-1-1+C2:2011.""" | ||
|
||
def test_evaluation(self) -> None: | ||
"""Test the evaluation of the result.""" | ||
# Example values | ||
beta_ds_tt_s = 0.25 # - | ||
k_h = 0.75 # - | ||
epsilon_cd_0 = 0.44 # - | ||
form_3_9 = Form3Dot9DryingShrinkage(beta_ds_tt_s=beta_ds_tt_s, k_h=k_h, epsilon_cd_0=epsilon_cd_0) | ||
|
||
# Expected result, manually calculated | ||
manually_calculated_result = 0.0825 | ||
|
||
assert form_3_9 == pytest.approx(expected=manually_calculated_result, rel=1e-4) | ||
|
||
def test_raise_error_when_negative_beta_ds_tt_s_is_given(self) -> None: | ||
"""Test that an error is raised when beta_ds_tt_s is negative""" | ||
# Example values | ||
beta_ds_tt_s = -0.25 # - | ||
k_h = 0.75 # - | ||
epsilon_cd_0 = 0.44 # - | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot9DryingShrinkage(beta_ds_tt_s=beta_ds_tt_s, k_h=k_h, epsilon_cd_0=epsilon_cd_0) | ||
|
||
def test_raise_error_when_negative_k_h_is_given(self) -> None: | ||
"""Test that an error is raised when k_h is negative""" | ||
# Example values | ||
beta_ds_tt_s = 0.25 # - | ||
k_h = -0.75 # - | ||
epsilon_cd_0 = 0.44 # - | ||
|
||
with pytest.raises(ValueError): | ||
Form3Dot9DryingShrinkage(beta_ds_tt_s=beta_ds_tt_s, k_h=k_h, epsilon_cd_0=epsilon_cd_0) |
Oops, something went wrong.