Skip to content

Instantly share code, notes, and snippets.

@jsb2505
Last active September 13, 2023 16:20
Show Gist options
  • Save jsb2505/590929c75b5fa081c924de322faec0d4 to your computer and use it in GitHub Desktop.
Save jsb2505/590929c75b5fa081c924de322faec0d4 to your computer and use it in GitHub Desktop.
A gist containing thermal lambda functions to BS EN 1991-1-5
Get_probability_of_exceedance = LAMBDA(return_period_years, 1 / return_period_years);
/**Uniform bridge contraction temperature range.
Ref: EC1-1-5 §6.1.3.3(3)
*/
Get_T_N_con = LAMBDA(T_0_con, T_e_min,
T_0_con - T_e_min
);
/**Uniform bridge expansion temperature range.
Ref: EC1-1-5 §6.1.3.3(3)
*/
Get_T_N_exp = LAMBDA(T_0_exp, T_e_max,
T_e_max - T_0_exp
);
/**Uniform bridge overall temperature range.
Ref: EC1-1-5 §6.1.3.3(3), NOTE 1
*/
Get_T_N = LAMBDA(T_e_min, T_e_max,
T_e_max - T_e_min
);
/**Maximum temperature for outer environment of buildings above ground level.
Ref: EC1-1-5 Table 5.2
*/
Get_T_out_max_above_ground = LAMBDA(t_max, absorptivity, direction,
LET(
T_index, IF(LOWER(direction) = "north-east", 1, 2),
T, IFS(
absorptivity = 0.5, CHOOSE(T_index, 0, 18),
absorptivity = 0.7, CHOOSE(T_index, 2, 30),
absorptivity = 0.9, CHOOSE(T_index, 4, 42)
),
t_max + T
)
);
/**Minimum temperature for outer environment of buildings above ground level.
Ref: EC1-1-5 Table 5.2
*/
Get_T_out_min_above_ground = LAMBDA(t_min, t_min);
/**Temperature for outer environment for underground parts of buildings.
Ref: EC1-1-5 Table 5.3
*/
Get_T_out_below_ground = LAMBDA(depth_below_ground_m, season,
IF(
LOWER(season) = "summer",
IF(depth_below_ground_m < 1, 8, 5),
IF(depth_below_ground_m < 1, -5, -3)
)
);
/**Adjustment amount for minimum shade air temperature based on altitude.
Ref: EC1-1-5 §A.1(1), Note 2
*/
Get_T_min_alt = LAMBDA(altitude,
-0.5 * QUOTIENT(altitude, 100)
);
/**Adjustment amount for maximum shade air temperature based on altitude.
Ref: EC1-1-5 §A.1(1), Note 2
*/
Get_T_max_alt = LAMBDA(altitude,
-1 * QUOTIENT(altitude, 100)
);
/**Minimum uniform bridge temperature.
Ref: EC1-1-5 Fig 6.1,
NA to EC1-1-5 §NA.2.5, Table NA.1 & §NA.2.2.2
*/
Get_T_e_min = LAMBDA(deck_type, t_min, [deck_surface], [cover_depth_mm],
LET(
_deck_type, LOWER(deck_type),
_deck_surface, IF(ISOMITTED(deck_surface), "", LOWER(deck_surface)),
_cover_depth_mm, IF(ISOMITTED(cover_depth_mm), 0, cover_depth_mm),
t_cover, MAX(QUOTIENT(_cover_depth_mm, 100) - 2, 0),
t_deck_index, RIGHT(_deck_type, 1),
t_deck, CHOOSE(t_deck_index, -3, 4, 8),
t_surface_arr, IFS(
_deck_surface = "", {0, 0, 0},
_deck_surface = "unsurfaced", {0, -3, -1},
_deck_surface = "waterproofed", {0, -3, -1},
_deck_surface = "40mm surfacing", {0, -2, -1},
_deck_surface = "100mm surfacing", {0, 0, 0},
_deck_surface = "200mm+ surfacing", {0, 3, 1}
),
t_surface, INDEX(t_surface_arr, t_deck_index),
t_min + t_deck + t_surface + t_cover
)
);
/**Maximum uniform bridge temperature.
Ref: EC1-1-5 Fig 6.1,
NA to EC1-1-5 §NA.2.5, Table NA.1 & §NA.2.2.2
*/
Get_T_e_max = LAMBDA(deck_type, t_max, [deck_surface], [cover_depth_mm],
LET(
_deck_type, LOWER(deck_type),
_deck_surface, IF(ISOMITTED(deck_surface), "", LOWER(deck_surface)),
_cover_depth_mm, IF(ISOMITTED(cover_depth_mm), 0, cover_depth_mm),
t_cover, MAX(QUOTIENT(_cover_depth_mm, 100) - 2, 0) * 2,
t_deck_index, RIGHT(_deck_type, 1),
t_deck, CHOOSE(t_deck_index, 16, 4, 2),
t_surface_arr, IFS(
_deck_surface = "", {0, 0, 0},
_deck_surface = "unsurfaced", {4, 0, 0},
_deck_surface = "waterproofed", {4, 4, 2},
_deck_surface = "40mm surfacing", {0, 2, 1},
_deck_surface = "100mm surfacing", {0, 0, 0},
_deck_surface = "200mm+ surfacing", {0, -4, -2}
),
t_surface, INDEX(t_surface_arr, t_deck_index),
t_max + t_deck + t_surface - t_cover
)
);
/**Minimum shade air temperature value with an annual probability of being exceeded other than 0.02
Ref: BS EN 1991-1-5 §A.2
*/
Get_T_min_p = LAMBDA(t_min, probability_of_exceedance,
LET(
p, probability_of_exceedance,
k_3, 0.393,
k_4, -0.156,
t_min * IF(p = 0.02, 1, (k_3 + k_4 * LN(-LN(1 - p))))
)
);
/**Maximum shade air temperature value with an annual probability of being exceeded other than 0.02
Ref: BS EN 1991-1-5 §A.2
*/
Get_T_max_p = LAMBDA(t_max, probability_of_exceedance,
LET(
p, probability_of_exceedance,
k_1, 0.781,
k_2, 0.056,
t_max * IF(p = 0.02, 1, (k_1 - k_2 * LN(-LN(1 - p))))
)
);
Get_Thermal_Elongation_with_Δt_mm = LAMBDA(coefficient_of_thermal_expansion, length_m, change_in_Temp,
LET(
α, coefficient_of_thermal_expansion,
L, length_m,
Δt, change_in_Temp,
α * L * Δt * 10^3
)
);
Get_Elongation_with_ε_mm = LAMBDA(strain, length_m,
LET(
ε, strain,
L, length_m,
ε *L * 10^3
)
);
Get_Strain_from_Elongation = LAMBDA(elongation_mm, original_length_m,
LET(
δL, elongation_mm / 10^3,
L, original_length_m,
δL / L
)
);
Get_Strain_from_Temperature = LAMBDA(coefficient_of_thermal_expansion, change_in_Temp,
LET(
α, coefficient_of_thermal_expansion,
Δt, change_in_Temp,
α * Δt
)
);
Get_Stress_from_Strain = LAMBDA(strain, secant_modulus_of_elasticity, [restraint],
LET(
ε, strain,
E_cm, secant_modulus_of_elasticity * 1000,
_restraint, IF(ISOMITTED(restraint), 1, restraint/100),
ε * E_cm * _restraint
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment