diff --git a/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials.py b/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials.py index caf12795..78b07fcf 100644 --- a/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials.py +++ b/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials.py @@ -4,12 +4,12 @@ from blueprints.codes.eurocode.nen_en_1992_1_1_c2_2011 import NEN_EN_1992_1_1_C2_2011 from blueprints.codes.formula import Formula -from blueprints.type_alias import MPA +from blueprints.type_alias import DAYS, MM, MM2, MPA class Form3Dot1EstimationConcreteCompressiveStrength(Formula): """Class representing formula 3.1 for the estimation of the concrete compressive strength, fcm(t), after t days - with an average temperature of 20 degrees Celsius [MPa].""" + with an average temperature of 20 degrees Celsius.""" label = "3.1" source_document = NEN_EN_1992_1_1_C2_2011 @@ -48,7 +48,7 @@ def _evaluate( class Form3Dot2CoefficientDependentOfConcreteAge(Formula): - """Class representing formula 3.2 for the coefficient βcc(t) which is dependent of the age of concrete [-].""" + """Class representing formula 3.2 for the coefficient βcc(t) which is dependent of the age of concrete.""" label = "3.2" source_document = NEN_EN_1992_1_1_C2_2011 @@ -56,7 +56,7 @@ class Form3Dot2CoefficientDependentOfConcreteAge(Formula): def __init__( self, s: float, - t: int, + t: DAYS, ) -> None: """Calculates beta_cc(t) coefficient which is dependent of the age of concrete in days [-]. @@ -70,7 +70,7 @@ def __init__( = 0.25 for cement of strength classes CEM 32.5 R, CEM 42.5 N (class N); = 0.38 for cement of strength class CEM 32.5 N (class S). Use your own implementation of this formula or use the SubForm3Dot2CoefficientTypeOfCementS class. - t : int + t : DAYS [t] Age of concrete in days [days]. """ super().__init__() @@ -80,7 +80,7 @@ def __init__( @staticmethod def _evaluate( s: float, - t: int, + t: DAYS, ) -> float: """Evaluates the formula, for more information see the __init__ method""" if s < 0: @@ -91,7 +91,8 @@ def _evaluate( class SubForm3Dot2CoefficientTypeOfCementS(Formula): - """Class representing sub-formula for formula 3.2, which calculates the coefficient s which is dependent on the cement class""" + """Class representing sub-formula for formula 3.2, which calculates the coefficient 's' + which is dependent on the cement class""" source_document = NEN_EN_1992_1_1_C2_2011 label = "3.2" @@ -130,3 +131,426 @@ def _evaluate( return 0.38 case _: raise ValueError(f"Invalid cement class: {cement_class}. Options: R, N or S") + + +class Form3Dot3AxialTensileStrengthFromTensileSplittingStrength(Formula): + """Class representing formula 3.3 for the approximated axial tensile strength, fct, determined by + tensile splitting strength.""" + + label = "3.3" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + f_ct_sp: MPA, + ) -> None: + """[fct] The approximated axial tensile strength when tensile strength is determined as coefficient + which is dependent of the age of concrete [MPa]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.2(8) - Formula (3.3) + + Parameters + ---------- + f_ct_sp : float + [fct,sp] Tensile strength determined by tensile splitting strength [MPa]. + """ + super().__init__() + self.f_ct_sp = f_ct_sp + + @staticmethod + def _evaluate( + f_ct_sp: MPA, + ) -> MPA: + """Evaluates the formula, for more information see the __init__ method""" + if f_ct_sp < 0: + raise ValueError(f"Negative f_ct_sp: {f_ct_sp}. f_ct_sp cannot be negative") + return 0.9 * f_ct_sp + + +class Form3Dot4DevelopmentTensileStrength(Formula): + """Class representing formula 3.4 for an initial estimation of the tensile strength, fctm(t), after t days.""" + + label = "3.4" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + beta_cc_t: float, + alpha: float, + f_ctm: MPA, + ) -> None: + """[fctm(t)] The initial estimation of the tensile strength after t days [MPa]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.2(9) - Formula (3.4) + + Parameters + ---------- + beta_cc_t : float + [βcc(t)] Coefficient dependent of the age of concrete [-]. + alpha : float + [α] Factor dependent of the age of concrete [-] + alpha = 1 for t < 28 days + alpha = 2/3 for t >= 28 days + Use your own implementation of this value or use the SubForm3Dot4CoefficientAgeConcreteAlpha class. + f_ctm : MPA + [fctm] Tensile strength from table 3.1 [MPa] + """ + super().__init__() + self.beta_cc_t = beta_cc_t + self.alpha = alpha + self.f_ctm = f_ctm + + @staticmethod + def _evaluate( + beta_cc_t: float, + alpha: float, + f_ctm: MPA, + ) -> MPA: + """Evaluates the formula, for more information see the __init__ method""" + if beta_cc_t < 0: + raise ValueError(f"Negative beta_cc_t: {beta_cc_t}. beta_cc_t cannot be negative") + if f_ctm < 0: + raise ValueError(f"Negative f_ctm: {f_ctm}. f_ctm cannot be negative") + if alpha < 0: + raise ValueError(f"Negative alpha: {alpha}. alpha cannot be negative") + return beta_cc_t**alpha * f_ctm + + +class SubForm3Dot4CoefficientAgeConcreteAlpha(Formula): + """Class representing sub-formula for formula 3.4 for the coefficient 'α' which + is dependent of the age of concrete.""" + + label = "3.4" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + t: DAYS, + ) -> None: + """[α] Factor dependent of the age of concrete [-]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.2(9) - α + + Parameters + ---------- + t : DAYS + [t] Age of concrete in days [days]. + """ + super().__init__() + self.t = t + + @staticmethod + def _evaluate( + t: DAYS, + ) -> float: + """Evaluates the formula, for more information see the __init__ method""" + if t <= 0: + raise ValueError(f"Invalid t: {t}. t cannot be negative or zero") + if t < 28: + return 1.0 + return 2 / 3 + + +class Form3Dot5ApproximationVarianceElasticModulusOverTime(Formula): + """Class representing formula 3.5 for the approximation of the elastic modulus, Ecm(t) at day t.""" + + label = "3.5" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + f_cm_t: MPA, + f_cm: MPA, + e_cm: MPA, + ) -> None: + """[Ecm(t)] The approximated elastic modulus at day t [MPa]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.3(3) - Formula (3.5) + + Parameters + ---------- + f_cm_t : MPA + [fcm(t)] Compressive strength concrete at t days [MPa]. + f_cm : MPA + [fcm] Average concrete compressive strength on day 28 based on table 3.1 [MPa]. + e_cm : MPA + [Ecm] Average elastic modulus on day 28 [MPa] + """ + super().__init__() + self.f_cm_t = f_cm_t + self.f_cm = f_cm + self.e_cm = e_cm + + @staticmethod + def _evaluate( + f_cm_t: MPA, + f_cm: MPA, + e_cm: MPA, + ) -> MPA: + """Evaluates the formula, for more information see the __init__ method""" + if f_cm_t < 0: + raise ValueError(f"Negative f_cm_t: {f_cm_t}. f_cm_t cannot be negative") + if f_cm < 0: + raise ValueError(f"Negative f_cm: {f_cm}. f_cm cannot be negative") + if e_cm < 0: + raise ValueError(f"Negative e_cm: {e_cm}. e_cm cannot be negative") + return (f_cm_t / f_cm) ** 0.3 * e_cm + + +class Form3Dot6CreepDeformationOfConcrete(Formula): + """Class representing formula 3.6 for the calculation of creep deformation of concrete.""" + + label = "3.6" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + phi_inf_t0: float, + sigma_c: MPA, + e_c: MPA, + ) -> None: + """εcc(∞,t0) Creep deformation of concrete at the time t = ∞ for a constant concrete compressive + stress σc applied at time t0 [-]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.4(3) - Formula (3.6) + + Parameters + ---------- + phi_inf_t0 : float + [φ(∞, t0)] Creep coefficient if high accuracy is not required use figure 3.1 else use appendix B [-]. + sigma_c : MPA + [σc] Concrete compressive stress [MPa]. + e_c : MPA + [Ec] tangent modulus = 1.05 * Ecm. According to art.3.1.4(2) [MPa]. + """ + super().__init__() + self.phi_inf_t0 = phi_inf_t0 + self.sigma_c = sigma_c + self.e_c = e_c + + @staticmethod + def _evaluate( + phi_inf_t0: float, + sigma_c: MPA, + e_c: MPA, + ) -> float: + """Evaluates the formula, for more information see the __init__ method""" + if phi_inf_t0 < 0: + raise ValueError(f"Negative phi_inf_t0: {phi_inf_t0}. phi_inf_t0 cannot be negative") + if sigma_c < 0: + raise ValueError(f"Negative sigma_c: {sigma_c}. sigma_c cannot be negative") + if e_c < 0: + raise ValueError(f"Negative e_c: {e_c}. e_c cannot be negative") + return phi_inf_t0 * sigma_c / e_c + + +class Form3Dot7NonLinearCreepCoefficient(Formula): + """Class representing formula 3.7 for the calculation of the non-linear creep coefficient.""" + + label = "3.7" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + phi_inf_t0: float, + k_sigma: float, + ) -> None: + """[φnl(∞,t0)] The non-linear creep coefficient [-]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.4(4) - Formula (3.7) + + Parameters + ---------- + phi_inf_t0 : float + [φ(∞, t0)] Creep coefficient if high accuracy is not required use figure 3.1 and/or use appendix B [-]. + k_sigma : float + [kσ] Stress-strength ratio (σc / fck(t0)) [-]. + """ + super().__init__() + self.phi_inf_t0 = phi_inf_t0 + self.k_sigma = k_sigma + + @staticmethod + def _evaluate( + phi_inf_t0: float, + k_sigma: float, + ) -> float: + """Evaluates the formula, for more information see the __init__ method""" + if phi_inf_t0 < 0: + raise ValueError(f"Negative phi_inf_t0: {phi_inf_t0}. phi_inf_t0 cannot be negative") + if k_sigma < 0: + raise ValueError(f"Negative k_sigma: {k_sigma}. k_sigma cannot be negative") + return phi_inf_t0 * np.exp(1.5 * (k_sigma - 0.45)) + + +class Form3Dot8TotalShrinkage(Formula): + """Class representing formula 3.8 for the calculation of the total shrinkage.""" + + label = "3.8" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + epsilon_cd: float, + epsilon_ca: float, + ) -> None: + """[εcs] The total shrinkage [-]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.4(6) - Formula (3.8) + + Parameters + ---------- + epsilon_cd : float + [εcd] Drying shrinkage [-]. + epsilon_ca : float + [εca] Autogene shrinkage [-]. + """ + super().__init__() + self.epsilon_cd = epsilon_cd + self.epsilon_ca = epsilon_ca + + @staticmethod + def _evaluate( + epsilon_cd: float, + epsilon_ca: float, + ) -> float: + """Evaluates the formula, for more information see the __init__ method""" + return epsilon_cd + epsilon_ca + + +class Form3Dot9DryingShrinkage(Formula): + """Class representing formula 3.9 for the calculation of the drying shrinkage.""" + + label = "3.9" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + beta_ds_tt_s: float, + k_h: float, + epsilon_cd_0: float, + ) -> None: + """[εcd(t)] Development of the drying shrinkage [-]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.4(6) - Formula (3.9) + + Parameters + ---------- + beta_ds_tt_s : float + [βds(t, ts)] Coefficient that depends on the age t (in days) of the concrete for the drying shrinkage [-]. + k_h : float + [kh] Coefficient depending on the fictional thickness h0 following table 3.3 [-]. + h0 = 100 -> kh = 1.0 + h0 = 200 -> kh = 0.85 + h0 = 300 -> kh = 0.75 + h0 >= 500 -> kh = 0.70 + epsilon_cd_0 : float + [εcd,0] Nominal unobstructed drying shrinkage, formula in appendix B or use table 3.2 [-] + """ + super().__init__() + self.beta_ds_tt_s = beta_ds_tt_s + self.k_h = k_h + self.epsilon_cd_0 = epsilon_cd_0 + + @staticmethod + def _evaluate( + beta_ds_tt_s: float, + k_h: float, + epsilon_cd_0: float, + ) -> float: + """Evaluates the formula, for more information see the __init__ method""" + if beta_ds_tt_s < 0: + raise ValueError(f"Negative beta_ds_tt_s: {beta_ds_tt_s}. beta_ds_tt_s cannot be negative") + if k_h < 0: + raise ValueError(f"Negative k_h: {k_h}. k_h cannot be negative") + return beta_ds_tt_s * k_h * epsilon_cd_0 + + +class Form3Dot10CoefficientAgeConcreteDryingShrinkage(Formula): + """Class representing formula 3.10 for the calculation of the coefficient for drying shrinkage due to age.""" + + label = "3.10" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + t: DAYS, + t_s: DAYS, + h_0: MM, + ) -> None: + """[βds(t,ts)] Coefficient for drying shrinkage due to age of concrete [-]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.4(6) - Formula (3.10) + + Parameters + ---------- + t : DAYS + [t] Age in days of the concrete at the considered moment [days]. + t_s : DAYS + [t] Age in days of the concrete at the start of the drying shrinkage [days]. + h_0 : MM + [h0] fictional thickness of cross-section [mm]. + = 2 * Ac / u + Use your own implementation of this formula or use the SubForm3Dot10FictionalCrossSection class. + """ + super().__init__() + self.t = t + self.t_s = t_s + self.h_0 = h_0 + + @staticmethod + def _evaluate( + t: DAYS, + t_s: DAYS, + h_0: MM, + ) -> float: + """Evaluates the formula, for more information see the __init__ method""" + if t <= 0: + raise ValueError(f"Invalid t: {t}. t cannot be negative or zero") + if t_s < 0: + raise ValueError(f"Negative t_s: {t_s}. t_s cannot be negative") + if t <= t_s: + raise ValueError("Invalid t and t_s combination. t has to be larger than t_s") + if h_0 <= 0: + raise ValueError(f"Invalid h_0: {h_0}. h_0 cannot be negative or zero") + return (t - t_s) / ((t - t_s) + 0.04 * np.sqrt(h_0**3)) + + +class SubForm3Dot10FictionalCrossSection(Formula): + """Class representing sub-formula for formula 3.10 for the calculation of fictional + thickness of the cross-section.""" + + label = "3.10" + source_document = NEN_EN_1992_1_1_C2_2011 + + def __init__( + self, + a_c: MM2, + u: MM, + ) -> None: + """[h0] Fictional thickness of the cross-section [mm]. + + NEN-EN 1992-1-1+C2:2011 art.3.1.4(6) - h0 + + Parameters + ---------- + a_c : MM2 + [Ac] Area of the cross-section of the concrete [mm²]. + u : MM + [u] Circumference of part that is subjected to drying [mm]. + """ + super().__init__() + self.a_c = a_c + self.u = u + + @staticmethod + def _evaluate( + a_c: MM2, + u: MM, + ) -> MM: + """Evaluates the formula, for more information see the __init__ method""" + if a_c <= 0: + raise ValueError(f"Invalid a_c: {a_c}. a_c cannot be negative or zero") + if u <= 0: + raise ValueError(f"Invalid u: {u}. u cannot be negative or zero") + return 2 * a_c / u diff --git a/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_7_serviceability_limit_state.py b/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_7_serviceability_limit_state.py index d8b38c26..bc4e2c65 100644 --- a/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_7_serviceability_limit_state.py +++ b/blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_7_serviceability_limit_state.py @@ -7,7 +7,7 @@ class Form7Dot3CoefficientKc(Formula): - """Class representing the formula 7.3 for the coefficient kc for flanges of tubular cross-sections and T-sections [-].""" + """Class representing the formula 7.3 for the coefficient kc for flanges of tubular cross-sections and T-sections.""" label = "7.3" source_document = NEN_EN_1992_1_1_C2_2011 @@ -44,7 +44,7 @@ def _evaluate( a_ct: MM2, f_ct_eff: MPA, ) -> float: - """Evaluates the formula, for more infor see the __init__ method""" + """Evaluates the formula, for more information see the __init__ method""" if a_ct <= 0: raise ValueError("The value of a_ct must be greater than zero.") if f_ct_eff <= 0: diff --git a/blueprints/type_alias.py b/blueprints/type_alias.py index ccd390fb..fd051d12 100644 --- a/blueprints/type_alias.py +++ b/blueprints/type_alias.py @@ -2,3 +2,5 @@ KN = float MM2 = float MPA = float +MM = float +DAYS = float diff --git a/docs/source/codes/eurocode/ec2_1992_1_1_2011/equations.md b/docs/source/codes/eurocode/ec2_1992_1_1_2011/equations.md index 95181df4..cd8f0ed7 100644 --- a/docs/source/codes/eurocode/ec2_1992_1_1_2011/equations.md +++ b/docs/source/codes/eurocode/ec2_1992_1_1_2011/equations.md @@ -7,309 +7,309 @@ The table presents a list of formulas from the Eurocode 2 standards for concrete Total of 304 formulas present. -| Formula number | Done | Remarks | Object name | -|:---------------|:------------------:|:--------|:-----------------------| -| 3.1 | :x: | | | -| 3.2 | :x: | | | -| 3.3 | :x: | | | -| 3.4 | :x: | | | -| 3.5 | :x: | | | -| 3.6 | :x: | | | -| 3.7 | :x: | | | -| 3.8 | :x: | | | -| 3.9 | :x: | | | -| 3.10 | :x: | | | -| 3.11 | :x: | | | -| 3.12 | :x: | | | -| 3.13 | :x: | | | -| 3.14 | :x: | | | -| 3.15 | :x: | | | -| 3.16 | :x: | | | -| 3.17 | :x: | | | -| 3.18 | :x: | | | -| 3.19 | :x: | | | -| 3.20 | :x: | | | -| 3.21 | :x: | | | -| 3.22 | :x: | | | -| 3.23 | :x: | | | -| 3.24 | :x: | | | -| 3.25 | :x: | | | -| 3.26 | :x: | | | -| 3.27 | :x: | | | -| 3.28 | :x: | | | -| 3.29 | :x: | | | -| 3.30 | :x: | | | -| 4.1 | :x: | | | -| 4.2 | :x: | | | -| 4.3N | :x: | | | -| 4.4N | :x: | | | -| 5.1 | :x: | | | -| 5.2 | :x: | | | -| 5.3a | :x: | | | -| 5.3b | :x: | | | -| 5.4 | :x: | | | -| 5.5 | :x: | | | -| 5.6 | :x: | | | -| 5.7 | :x: | | | -| 5.7a | :x: | | | -| 5.7b | :x: | | | -| 5.8 | :x: | | | -| 5.9 | :x: | | | -| 5.10a | :x: | | | -| 5.10b | :x: | | | -| 5.11N | :x: | | | -| 5.12N | :x: | | | -| 5.13N | :x: | | | -| 5.14 | :x: | | | -| 5.15 | :x: | | | -| 5.16 | :x: | | | -| 5.17 | :x: | | | -| 5.18 | :x: | | | -| 5.19 | :x: | | | -| 5.20 | :x: | | | -| 5.21 | :x: | | | -| 5.22 | :x: | | | -| 5.23 | :x: | | | -| 5.24 | :x: | | | -| 5.25 | :x: | | | -| 5.26 | :x: | | | -| 5.27 | :x: | | | -| 5.28 | :x: | | | -| 5.29 | :x: | | | -| 5.30 | :x: | | | -| 5.31 | :x: | | | -| 5.32 | :x: | | | -| 5.33 | :x: | | | -| 5.34 | :x: | | | -| 5.35 | :x: | | | -| 5.36 | :x: | | | -| 5.37 | :x: | | | -| 5.38a | :x: | | | -| 5.38b | :x: | | | -| 5.39 | :x: | | | -| 5.40a | :x: | | | -| 5.40b | :x: | | | -| 5.41 | :x: | | | -| 5.42 | :x: | | | -| 5.43 | :x: | | | -| 5.44 | :x: | | | -| 5.45 | :x: | | | -| 5.46 | :x: | | | -| 5.47 | :x: | | | -| 5.48 | :x: | | | -| 6.1 | :x: | | | -| 6.2.a | :x: | | | -| 6.2.b | :x: | | | -| 6.3N | :x: | | | -| 6.4 | :x: | | | -| 6.5 | :x: | | | -| 6.6N | :x: | | | -| 6.7N | :x: | | | -| 6.8 | :x: | | | -| 6.9 | :x: | | | -| 6.10.aN | :x: | | | -| 6.10.bN | :x: | | | -| 6.11.aN | :x: | | | -| 6.11.bN | :x: | | | -| 6.11.cN | :x: | | | -| 6.12 | :x: | | | -| 6.13 | :x: | | | -| 6.14 | :x: | | | -| 6.15 | :x: | | | -| 6.16 | :x: | | | -| 6.17 | :x: | | | -| 6.18 | :x: | | | -| 6.19 | :x: | | | -| 6.20 | :x: | | | -| 6.21 | :x: | | | -| 6.22 | :x: | | | -| 6.23 | :x: | | | -| 6.24 | :x: | | | -| 6.25 | :x: | | | -| 6.26 | :x: | | | -| 6.27 | :x: | | | -| 6.28 | :x: | | | -| 6.29 | :x: | | | -| 6.30 | :x: | | | -| 6.31 | :x: | | | -| 6.32 | :x: | | | -| 6.33 | :x: | | | -| 6.34 | :x: | | | -| 6.35 | :x: | | | -| 6.36 | :x: | | | -| 6.37 | :x: | | | -| 6.38 | :x: | | | -| 6.39 | :x: | | | -| 6.40 | :x: | | | -| 6.41 | :x: | | | -| 6.42 | :x: | | | -| 6.43 | :x: | | | -| 6.44 | :x: | | | -| 6.45 | :x: | | | -| 6.46 | :x: | | | -| 6.47 | :x: | | | -| 6.48 | :x: | | | -| 6.49 | :x: | | | -| 6.50 | :x: | | | -| 6.51 | :x: | | | -| 6.52 | :x: | | | -| 6.53 | :x: | | | -| 6.54 | :x: | | | -| 6.55 | :x: | | | -| 6.56 | :x: | | | -| 6.57N | :x: | | | -| 6.58 | :x: | | | -| 6.59 | :x: | | | -| 6.60 | :x: | | | -| 6.61 | :x: | | | -| 6.62 | :x: | | | -| 6.63 | :x: | | | -| 6.64 | :x: | | | -| 6.65 | :x: | | | -| 6.66 | :x: | | | -| 6.67 | :x: | | | -| 6.68 | :x: | | | -| 6.69 | :x: | | | -| 6.70 | :x: | | | -| 6.71 | :x: | | | -| 6.72 | :x: | | | -| 6.73 | :x: | | | -| 6.74 | :x: | | | -| 6.75 | :x: | | | -| 6.76 | :x: | | | -| 6.77 | :x: | | | -| 6.78 | :x: | | | -| 6.79 | :x: | | | -| 7.1 | :x: | | | -| 7.2 | :x: | | | -| 7.3 | :heavy_check_mark: | | Form7Dot3CoefficientKc | -| 7.4 | :x: | | | -| 7.5 | :x: | | | -| 7.6N | :x: | | | -| 7.7N | :x: | | | -| 7.8 | :x: | | | -| 7.9 | :x: | | | -| 7.10 | :x: | | | -| 7.11 | :x: | | | -| 7.12 | :x: | | | -| 7.13 | :x: | | | -| 7.14 | :x: | | | -| 7.15 | :x: | | | -| 7.16.a | :x: | | | -| 7.16.b | :x: | | | -| 7.17 | :x: | | | -| 7.18 | :x: | | | -| 7.19 | :x: | | | -| 7.20 | :x: | | | -| 7.21 | :x: | | | -| 8.1 | :x: | | | -| 8.2 | :x: | | | -| 8.3 | :x: | | | -| 8.4 | :x: | | | -| 8.5 | :x: | | | -| 8.6 | :x: | | | -| 8.7 | :x: | | | -| 8.8N | :x: | | | -| 8.9 | :x: | | | -| 8.10 | :x: | | | -| 8.11 | :x: | | | -| 8.12 | :x: | | | -| 8.13 | :x: | | | -| 8.14 | :x: | | | -| 8.15 | :x: | | | -| 8.16 | :x: | | | -| 8.17 | :x: | | | -| 8.18 | :x: | | | -| 8.19 | :x: | | | -| 8.20 | :x: | | | -| 8.21 | :x: | | | -| 9.1N | :x: | | | -| 9.2 | :x: | | | -| 9.3 | :x: | | | -| 9.4 | :x: | | | -| 9.5N | :x: | | | -| 9.6N | :x: | | | -| 9.7N | :x: | | | -| 9.8N | :x: | | | -| 9.9 | :x: | | | -| 9.10 | :x: | | | -| 9.11 | :x: | | | -| 9.12N | :x: | | | -| 9.13 | :x: | | | -| 9.14 | :x: | | | -| 9.15 | :x: | | | -| 9.16 | :x: | | | -| 10.1 | :x: | | | -| 10.2 | :x: | | | -| 10.3 | :x: | | | -| 10.4 | :x: | | | -| 10.5 | :x: | | | -| 10.6 | :x: | | | -| 11.1 | :x: | | | -| 11.2 | :x: | | | -| 11.3.15 | :x: | | | -| 11.3.16 | :x: | | | -| 11.3.24 | :x: | | | -| 11.3.26 | :x: | | | -| 11.3.27 | :x: | | | -| 11.6.2 | :x: | | | -| 11.6.5 | :x: | | | -| 11.6.6N | :x: | | | -| 11.6.47 | :x: | | | -| 11.6.50 | :x: | | | -| 11.6.52 | :x: | | | -| 11.6.53 | :x: | | | -| 11.6.63 | :x: | | | -| 12.1 | :x: | | | -| 12.2 | :x: | | | -| 12.3 | :x: | | | -| 12.4 | :x: | | | -| 12.5 | :x: | | | -| 12.6 | :x: | | | -| 12.7 | :x: | | | -| 12.8 | :x: | | | -| 12.9 | :x: | | | -| 12.10 | :x: | | | -| 12.11 | :x: | | | -| 12.12 | :x: | | | -| 12.13 | :x: | | | -| B.1 | :x: | | | -| B.2 | :x: | | | -| B.3a | :x: | | | -| B.3b | :x: | | | -| B.4 | :x: | | | -| B.5 | :x: | | | -| B.6 | :x: | | | -| B.7 | :x: | | | -| B.8a | :x: | | | -| B.8b | :x: | | | -| B.8c | :x: | | | -| B.9 | :x: | | | -| B.10 | :x: | | | -| B.11 | :x: | | | -| B.12 | :x: | | | -| C.1N | :x: | | | -| C.2N | :x: | | | -| C.3 | :x: | | | -| D.1 | :x: | | | -| D.2 | :x: | | | -| F.1 | :x: | | | -| F.2 | :x: | | | -| F.3 | :x: | | | -| F.4 | :x: | | | -| F.5 | :x: | | | -| F.6 | :x: | | | -| F.7 | :x: | | | -| F.8 | :x: | | | -| F.9 | :x: | | | -| F.10 | :x: | | | -| G.1 | :x: | | | -| H.1 | :x: | | | -| H.2 | :x: | | | -| H.3 | :x: | | | -| H.4 | :x: | | | -| H.5 | :x: | | | -| H.6 | :x: | | | -| H.7 | :x: | | | -| H.8 | :x: | | | -| I.1 | :x: | | | +| Formula number | Done | Remarks | Object name | +|:---------------|:------------------:|:--------|:----------------------------------------------------------| +| 3.1 | :heavy_check_mark: | | Form3Dot1EstimationConcreteCompressiveStrength | +| 3.2 | :heavy_check_mark: | | Form3Dot2CoefficientDependentOfConcreteAge | +| 3.3 | :heavy_check_mark: | | Form3Dot3AxialTensileStrengthFromTensileSplittingStrength | +| 3.4 | :heavy_check_mark: | | Form3Dot4DevelopmentTensileStrength | +| 3.5 | :heavy_check_mark: | | Form3Dot5ApproximationVarianceElasticModulusOverTime | +| 3.6 | :heavy_check_mark: | | Form3Dot6CreepDeformationOfConcrete | +| 3.7 | :heavy_check_mark: | | Form3Dot7NonLinearCreepCoefficient | +| 3.8 | :heavy_check_mark: | | Form3Dot8TotalShrinkage | +| 3.9 | :heavy_check_mark: | | Form3Dot9DryingShrinkage | +| 3.10 | :heavy_check_mark: | | Form3Dot10CoefficientAgeConcreteDryingShrinkage | +| 3.11 | :x: | | | +| 3.12 | :x: | | | +| 3.13 | :x: | | | +| 3.14 | :x: | | | +| 3.15 | :x: | | | +| 3.16 | :x: | | | +| 3.17 | :x: | | | +| 3.18 | :x: | | | +| 3.19 | :x: | | | +| 3.20 | :x: | | | +| 3.21 | :x: | | | +| 3.22 | :x: | | | +| 3.23 | :x: | | | +| 3.24 | :x: | | | +| 3.25 | :x: | | | +| 3.26 | :x: | | | +| 3.27 | :x: | | | +| 3.28 | :x: | | | +| 3.29 | :x: | | | +| 3.30 | :x: | | | +| 4.1 | :x: | | | +| 4.2 | :x: | | | +| 4.3N | :x: | | | +| 4.4N | :x: | | | +| 5.1 | :x: | | | +| 5.2 | :x: | | | +| 5.3a | :x: | | | +| 5.3b | :x: | | | +| 5.4 | :x: | | | +| 5.5 | :x: | | | +| 5.6 | :x: | | | +| 5.7 | :x: | | | +| 5.7a | :x: | | | +| 5.7b | :x: | | | +| 5.8 | :x: | | | +| 5.9 | :x: | | | +| 5.10a | :x: | | | +| 5.10b | :x: | | | +| 5.11N | :x: | | | +| 5.12N | :x: | | | +| 5.13N | :x: | | | +| 5.14 | :x: | | | +| 5.15 | :x: | | | +| 5.16 | :x: | | | +| 5.17 | :x: | | | +| 5.18 | :x: | | | +| 5.19 | :x: | | | +| 5.20 | :x: | | | +| 5.21 | :x: | | | +| 5.22 | :x: | | | +| 5.23 | :x: | | | +| 5.24 | :x: | | | +| 5.25 | :x: | | | +| 5.26 | :x: | | | +| 5.27 | :x: | | | +| 5.28 | :x: | | | +| 5.29 | :x: | | | +| 5.30 | :x: | | | +| 5.31 | :x: | | | +| 5.32 | :x: | | | +| 5.33 | :x: | | | +| 5.34 | :x: | | | +| 5.35 | :x: | | | +| 5.36 | :x: | | | +| 5.37 | :x: | | | +| 5.38a | :x: | | | +| 5.38b | :x: | | | +| 5.39 | :x: | | | +| 5.40a | :x: | | | +| 5.40b | :x: | | | +| 5.41 | :x: | | | +| 5.42 | :x: | | | +| 5.43 | :x: | | | +| 5.44 | :x: | | | +| 5.45 | :x: | | | +| 5.46 | :x: | | | +| 5.47 | :x: | | | +| 5.48 | :x: | | | +| 6.1 | :x: | | | +| 6.2.a | :x: | | | +| 6.2.b | :x: | | | +| 6.3N | :x: | | | +| 6.4 | :x: | | | +| 6.5 | :x: | | | +| 6.6N | :x: | | | +| 6.7N | :x: | | | +| 6.8 | :x: | | | +| 6.9 | :x: | | | +| 6.10.aN | :x: | | | +| 6.10.bN | :x: | | | +| 6.11.aN | :x: | | | +| 6.11.bN | :x: | | | +| 6.11.cN | :x: | | | +| 6.12 | :x: | | | +| 6.13 | :x: | | | +| 6.14 | :x: | | | +| 6.15 | :x: | | | +| 6.16 | :x: | | | +| 6.17 | :x: | | | +| 6.18 | :x: | | | +| 6.19 | :x: | | | +| 6.20 | :x: | | | +| 6.21 | :x: | | | +| 6.22 | :x: | | | +| 6.23 | :x: | | | +| 6.24 | :x: | | | +| 6.25 | :x: | | | +| 6.26 | :x: | | | +| 6.27 | :x: | | | +| 6.28 | :x: | | | +| 6.29 | :x: | | | +| 6.30 | :x: | | | +| 6.31 | :x: | | | +| 6.32 | :x: | | | +| 6.33 | :x: | | | +| 6.34 | :x: | | | +| 6.35 | :x: | | | +| 6.36 | :x: | | | +| 6.37 | :x: | | | +| 6.38 | :x: | | | +| 6.39 | :x: | | | +| 6.40 | :x: | | | +| 6.41 | :x: | | | +| 6.42 | :x: | | | +| 6.43 | :x: | | | +| 6.44 | :x: | | | +| 6.45 | :x: | | | +| 6.46 | :x: | | | +| 6.47 | :x: | | | +| 6.48 | :x: | | | +| 6.49 | :x: | | | +| 6.50 | :x: | | | +| 6.51 | :x: | | | +| 6.52 | :x: | | | +| 6.53 | :x: | | | +| 6.54 | :x: | | | +| 6.55 | :x: | | | +| 6.56 | :x: | | | +| 6.57N | :x: | | | +| 6.58 | :x: | | | +| 6.59 | :x: | | | +| 6.60 | :x: | | | +| 6.61 | :x: | | | +| 6.62 | :x: | | | +| 6.63 | :x: | | | +| 6.64 | :x: | | | +| 6.65 | :x: | | | +| 6.66 | :x: | | | +| 6.67 | :x: | | | +| 6.68 | :x: | | | +| 6.69 | :x: | | | +| 6.70 | :x: | | | +| 6.71 | :x: | | | +| 6.72 | :x: | | | +| 6.73 | :x: | | | +| 6.74 | :x: | | | +| 6.75 | :x: | | | +| 6.76 | :x: | | | +| 6.77 | :x: | | | +| 6.78 | :x: | | | +| 6.79 | :x: | | | +| 7.1 | :x: | | | +| 7.2 | :x: | | | +| 7.3 | :heavy_check_mark: | | Form7Dot3CoefficientKc | +| 7.4 | :x: | | | +| 7.5 | :x: | | | +| 7.6N | :x: | | | +| 7.7N | :x: | | | +| 7.8 | :x: | | | +| 7.9 | :x: | | | +| 7.10 | :x: | | | +| 7.11 | :x: | | | +| 7.12 | :x: | | | +| 7.13 | :x: | | | +| 7.14 | :x: | | | +| 7.15 | :x: | | | +| 7.16.a | :x: | | | +| 7.16.b | :x: | | | +| 7.17 | :x: | | | +| 7.18 | :x: | | | +| 7.19 | :x: | | | +| 7.20 | :x: | | | +| 7.21 | :x: | | | +| 8.1 | :x: | | | +| 8.2 | :x: | | | +| 8.3 | :x: | | | +| 8.4 | :x: | | | +| 8.5 | :x: | | | +| 8.6 | :x: | | | +| 8.7 | :x: | | | +| 8.8N | :x: | | | +| 8.9 | :x: | | | +| 8.10 | :x: | | | +| 8.11 | :x: | | | +| 8.12 | :x: | | | +| 8.13 | :x: | | | +| 8.14 | :x: | | | +| 8.15 | :x: | | | +| 8.16 | :x: | | | +| 8.17 | :x: | | | +| 8.18 | :x: | | | +| 8.19 | :x: | | | +| 8.20 | :x: | | | +| 8.21 | :x: | | | +| 9.1N | :x: | | | +| 9.2 | :x: | | | +| 9.3 | :x: | | | +| 9.4 | :x: | | | +| 9.5N | :x: | | | +| 9.6N | :x: | | | +| 9.7N | :x: | | | +| 9.8N | :x: | | | +| 9.9 | :x: | | | +| 9.10 | :x: | | | +| 9.11 | :x: | | | +| 9.12N | :x: | | | +| 9.13 | :x: | | | +| 9.14 | :x: | | | +| 9.15 | :x: | | | +| 9.16 | :x: | | | +| 10.1 | :x: | | | +| 10.2 | :x: | | | +| 10.3 | :x: | | | +| 10.4 | :x: | | | +| 10.5 | :x: | | | +| 10.6 | :x: | | | +| 11.1 | :x: | | | +| 11.2 | :x: | | | +| 11.3.15 | :x: | | | +| 11.3.16 | :x: | | | +| 11.3.24 | :x: | | | +| 11.3.26 | :x: | | | +| 11.3.27 | :x: | | | +| 11.6.2 | :x: | | | +| 11.6.5 | :x: | | | +| 11.6.6N | :x: | | | +| 11.6.47 | :x: | | | +| 11.6.50 | :x: | | | +| 11.6.52 | :x: | | | +| 11.6.53 | :x: | | | +| 11.6.63 | :x: | | | +| 12.1 | :x: | | | +| 12.2 | :x: | | | +| 12.3 | :x: | | | +| 12.4 | :x: | | | +| 12.5 | :x: | | | +| 12.6 | :x: | | | +| 12.7 | :x: | | | +| 12.8 | :x: | | | +| 12.9 | :x: | | | +| 12.10 | :x: | | | +| 12.11 | :x: | | | +| 12.12 | :x: | | | +| 12.13 | :x: | | | +| B.1 | :x: | | | +| B.2 | :x: | | | +| B.3a | :x: | | | +| B.3b | :x: | | | +| B.4 | :x: | | | +| B.5 | :x: | | | +| B.6 | :x: | | | +| B.7 | :x: | | | +| B.8a | :x: | | | +| B.8b | :x: | | | +| B.8c | :x: | | | +| B.9 | :x: | | | +| B.10 | :x: | | | +| B.11 | :x: | | | +| B.12 | :x: | | | +| C.1N | :x: | | | +| C.2N | :x: | | | +| C.3 | :x: | | | +| D.1 | :x: | | | +| D.2 | :x: | | | +| F.1 | :x: | | | +| F.2 | :x: | | | +| F.3 | :x: | | | +| F.4 | :x: | | | +| F.5 | :x: | | | +| F.6 | :x: | | | +| F.7 | :x: | | | +| F.8 | :x: | | | +| F.9 | :x: | | | +| F.10 | :x: | | | +| G.1 | :x: | | | +| H.1 | :x: | | | +| H.2 | :x: | | | +| H.3 | :x: | | | +| H.4 | :x: | | | +| H.5 | :x: | | | +| H.6 | :x: | | | +| H.7 | :x: | | | +| H.8 | :x: | | | +| I.1 | :x: | | | diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_10.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_10.py new file mode 100644 index 00000000..373aa700 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_10.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_3.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_3.py new file mode 100644 index 00000000..6dc051e9 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_3.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_4.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_4.py new file mode 100644 index 00000000..007d0e18 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_4.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_5.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_5.py new file mode 100644 index 00000000..b7583231 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_5.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_6.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_6.py new file mode 100644 index 00000000..7dfa8603 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_6.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_7.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_7.py new file mode 100644 index 00000000..bf2e7af3 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_7.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_8.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_8.py new file mode 100644 index 00000000..8720872d --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_8.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_9.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_9.py new file mode 100644 index 00000000..eeed56fb --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_formula_3_9.py @@ -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) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_10.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_10.py new file mode 100644 index 00000000..0b3e6c47 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_10.py @@ -0,0 +1,39 @@ +"""Testing sub-formula for 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 SubForm3Dot10FictionalCrossSection + + +class TestSubForm3Dot10FictionalCrossSection: + """Validation for sub-formula for 3.10 from NEN-EN 1992-1-1+C2:2011.""" + + def test_evaluation(self) -> None: + """Test the evaluation of the result.""" + # Example values + a_c = 42.5 # mm² + u = 20.3 # mm + sub_form_3_10 = SubForm3Dot10FictionalCrossSection(a_c=a_c, u=u) + + # Expected result, manually calculated + manually_calculated_result = 4.187192 + + assert sub_form_3_10 == pytest.approx(expected=manually_calculated_result, rel=1e-4) + + def test_raise_error_when_negative_a_c_is_given(self) -> None: + """Test a negative value.""" + # Example values + a_c = -42.5 # mm² + u = 20.3 # mm + + with pytest.raises(ValueError): + SubForm3Dot10FictionalCrossSection(a_c=a_c, u=u) + + def test_raise_error_when_negative_u_is_given(self) -> None: + """Test a negative value.""" + # Example values + a_c = 42.5 # mm² + u = -20.3 # mm + + with pytest.raises(ValueError): + SubForm3Dot10FictionalCrossSection(a_c=a_c, u=u) diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_2.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_2.py index 9f7fbaf9..830b03bc 100644 --- a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_2.py +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_2.py @@ -10,17 +10,29 @@ class TestSubForm3Dot2CoefficientTypeOfCementS: def test_evaluation(self) -> None: """Test the evaluation of the result.""" - # Example values + # Example value 1 cement_class = "R" # str sub_form_3_2 = SubForm3Dot2CoefficientTypeOfCementS(cement_class=cement_class) - # Expected result, manually calculated manually_result = 0.20 + assert sub_form_3_2 == pytest.approx(expected=manually_result, rel=1e-4) + + # Example value 2 + cement_class = "N" # str + sub_form_3_2 = SubForm3Dot2CoefficientTypeOfCementS(cement_class=cement_class) + # Expected result, manually calculated + manually_result = 0.25 + assert sub_form_3_2 == pytest.approx(expected=manually_result, rel=1e-4) + # Example value 3 + cement_class = "S" # str + sub_form_3_2 = SubForm3Dot2CoefficientTypeOfCementS(cement_class=cement_class) + # Expected result, manually calculated + manually_result = 0.38 assert sub_form_3_2 == pytest.approx(expected=manually_result, rel=1e-4) def test_raise_error_when_invalid_cement_class_is_given(self) -> None: - """Test the evaluation of the result.""" + """Test an invalid cement class.""" # Example values cement_class = "V" # str diff --git a/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_4.py b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_4.py new file mode 100644 index 00000000..df73f4e9 --- /dev/null +++ b/tests/codes/eurocode/nen_en_1992_1_1_c2_2011/chapter_3_materials/test_sub_formula_3_4.py @@ -0,0 +1,41 @@ +"""Testing sub-formula for 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 SubForm3Dot4CoefficientAgeConcreteAlpha + + +class TestSubForm3Dot4CoefficientAgeConcreteAlpha: + """Validation for sub-formula 3.4 from NEN-EN 1992-1-1+C2:2011.""" + + def test_t_between_0_and_28(self) -> None: + """Test the evaluation of the result.""" + # Example value 1 + t = 10 # days + + sub_form_3_4 = SubForm3Dot4CoefficientAgeConcreteAlpha(t=t) + + # Expected result, manually calculated + manually_result = 1.0 + + assert sub_form_3_4 == pytest.approx(expected=manually_result, rel=1e-4) + + def test_raise_error_when_t_lower_or_equal_to_0(self) -> None: + """Test the evaluation of the result.""" + # Example value 1 + t = 0 # days + + with pytest.raises(ValueError): + SubForm3Dot4CoefficientAgeConcreteAlpha(t=t) + + def test_t_higher_then_28(self) -> None: + """Test the evaluation of the result.""" + # Example value 1 + t = 50 # days + + sub_form_3_4 = SubForm3Dot4CoefficientAgeConcreteAlpha(t=t) + + # Expected result, manually calculated + manually_result = 2 / 3 + + assert sub_form_3_4 == pytest.approx(expected=manually_result, rel=1e-4)