Skip to content

Instantly share code, notes, and snippets.

@jsb2505
Last active July 22, 2024 14:02
Show Gist options
  • Save jsb2505/319cb0037b59094bbcf242a06a628427 to your computer and use it in GitHub Desktop.
Save jsb2505/319cb0037b59094bbcf242a06a628427 to your computer and use it in GitHub Desktop.
A gist for Ciria C766 lambda functions
calculate_temperature_rise_from_20_degs_over_time = LAMBDA(binder_content, total_heat, concrete_density, time_elapsed_hrs,
time_elapsed_hrs * binder_content / (total_heat * concrete_Density)
);
calculate_temperature = LAMBDA(temp_rise_from_20_deg, [test_mix_temp],
LET(
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
_test_mix_temp + temp_rise_from_20_deg
)
);
calculate_temperature_rise = LAMBDA(placing_temp, temp_rise_from_20_degs, T_ult, [test_mix_temp],
LET(
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
T_ult_adjusted, T_ult - 0.2*(placing_temp - _test_mix_temp),
placing_temp + (temp_rise_from_20_degs * T_ult_adjusted / T_ult)
)
);
calculate_ultimate_temperature_T_ult = LAMBDA(Q_ult, binder_content, [specific_heat], [concrete_density],
LET(
_specific_heat, IF(ISOMITTED(specific_heat), 1, specific_heat),
_concrete_density, IF(ISOMITTED(concrete_density), 2400, concrete_density),
Q_ult * binder_content / (_specific_heat * _concrete_density)
)
);
calculate_ultimate_temperature_T_ult_adjusted = LAMBDA(Q_ult, binder_content, placing_temp, [specific_heat], [concrete_density], [test_mix_temp],
LET(
_specific_heat, IF(ISOMITTED(specific_heat), 1, specific_heat),
_concrete_density, IF(ISOMITTED(concrete_density), 2400, concrete_density),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
T_ult, calculate_ultimate_temperature_T_ult(Q_ult, binder_content, _specific_heat, _concrete_density),
adjuster, 0.2*(placing_temp - _test_mix_temp),
T_ult - adjuster
)
);
calculate_modelled_temperature_over_time = LAMBDA(time_elapsed_hrs, binder_content, binder_type,
addition_percent, placing_temp, [multiplier], [test_mix_temp], [rastrup_coefficient], [specific_heat], [concrete_density],
LET(
_specific_heat, IF(ISOMITTED(specific_heat), 1, specific_heat),
_concrete_density, IF(ISOMITTED(concrete_density), 2400, concrete_density),
_rastrup_coefficient, IF(ISOMITTED(rastrup_coefficient), 12, rastrup_coefficient),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
_multiplier, IF(ISOMITTED(multiplier), 1, multiplier),
ggbs_calibration_factor, get_ggbs_calibration_factor(binder_type, addition_percent),
coefficient_B, get_coefficient_B_adjusted(placing_temp, _test_mix_temp),
coefficient_C, get_coefficient_C_adjusted(binder_type, addition_percent, placing_temp, _test_mix_temp),
coefficient_D, get_coefficient_D_adjusted(binder_type, addition_percent, placing_temp, _test_mix_temp),
activation_time_t2, get_activation_time_t2_adjusted(binder_type, addition_percent, placing_temp, _test_mix_temp, _rastrup_coefficient),
time_elapsed_adjusted_hrs, time_adjusted_by_rastrup_function(time_elapsed_hrs, placing_temp, _test_mix_temp, _rastrup_coefficient),
Q_ult, get_ultimate_heat_generation_Q_ult(binder_type, addition_percent),
T_ult_adjusted, calculate_ultimate_temperature_T_ult_adjusted(Q_ult, binder_content, placing_temp, _specific_heat, _concrete_density, _test_mix_temp),
T_1, 0.5 * T_ult_adjusted * (1 - EXP(-coefficient_B * time_elapsed_adjusted_hrs^coefficient_C)),
T_2, 0.5 * T_ult_adjusted,
T_2_adjuster, IF(time_elapsed_adjusted_hrs < activation_time_t2,
0,
(time_elapsed_adjusted_hrs - activation_time_t2) / (time_elapsed_adjusted_hrs - activation_time_t2 + coefficient_D)
),
placing_temp + ggbs_calibration_factor * _multiplier * (T_1 + T_2*T_2_adjuster)
)
);
calculate_total_heat_generated_Q_over_time = LAMBDA(time_elapsed_hrs, binder_type, addition_percent, [multiplier],
LET(
_multiplier, IF(ISOMITTED(multiplier), 1, multiplier),
ggbs_calibration_factor, get_ggbs_calibration_factor(binder_type, addition_percent),
coefficient_B, get_coefficient_B(),
coefficient_C, get_coefficient_C(binder_type, addition_percent),
coefficient_D, get_coefficient_D(binder_type, addition_percent),
activation_time_t2, get_activation_time_t2(binder_type, addition_percent),
Q_ult, get_ultimate_heat_generation_Q_ult(binder_type, addition_percent),
Q_1, (1/2) * Q_ult * (1 - EXP(-coefficient_B * time_elapsed_hrs^coefficient_C)),
Q_2, (1/2) * Q_ult,
Q_2_adjuster, IF(time_elapsed_hrs < activation_time_t2,
0,
(time_elapsed_hrs - activation_time_t2) / (time_elapsed_hrs - activation_time_t2 + coefficient_D)
),
ggbs_calibration_factor * _multiplier * (Q_1 + Q_2*Q_2_adjuster)
)
);
get_coefficient_B = LAMBDA([coefficient_B],
IF(ISOMITTED(coefficient_B), 0.011724, coefficient_B)
);
get_coefficient_B_adjusted = LAMBDA(placing_temp, [test_mix_temp],
LET(
coefficient_B, get_coefficient_B(),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
adjuster, IF(placing_temp <> _test_mix_temp,
0.1387 * EXP(0.0999 * placing_temp) / (0.1387 * EXP(0.0999 * _test_mix_temp)),
1
),
coefficient_B * adjuster
)
);
get_coefficient_C = LAMBDA(binder_type, addition_percent,
LET(
_binder_type, LOWER(binder_type),
cem_1_factor, 1.6,
binder_mod_factor, IFS(
_binder_type = "cem 1", 0,
_binder_type = "fly ash", -0.001 * addition_percent,
_binder_type = "ggbs", -0.0072*addition_percent - 0.00003*addition_percent^2
),
cem_1_factor + binder_mod_factor
)
);
get_coefficient_C_adjusted = LAMBDA(binder_type, addition_percent, placing_temp, [test_mix_temp],
LET(
coefficient_C, get_coefficient_C(binder_type, addition_percent),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
adjuster, IF(placing_temp <> _test_mix_temp,
(placing_temp - _test_mix_temp) / 2000,
0
),
coefficient_C + adjuster
)
);
get_coefficient_D = LAMBDA(binder_type, addition_percent,
LET(
_binder_type, LOWER(binder_type),
cem_1_factor, 6.2,
binder_mod_factor, IFS(
_binder_type = "cem 1", 0,
_binder_type = "fly ash", 0.2131 * addition_percent,
_binder_type = "ggbs", 0.0848*addition_percent - 0.0004*addition_percent^2
),
cem_1_factor + binder_mod_factor
)
);
get_coefficient_D_adjusted = LAMBDA(binder_type, addition_percent, placing_temp, [test_mix_temp],
LET(
coefficient_D, get_coefficient_D(binder_type, addition_percent),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
adjuster, IF(placing_temp <> _test_mix_temp,
(0.0022*(placing_temp^2) - 0.1503*placing_temp + 3.1483) / (0.0022*(_test_mix_temp^2) - 0.1503*_test_mix_temp + 3.1483),
1
),
coefficient_D * adjuster
)
);
get_activation_time_t2 = LAMBDA(binder_type, addition_percent,
LET(
_binder_type, LOWER(binder_type),
cem_1_factor, 3.5,
binder_mod_factor, IFS(
_binder_type = "cem 1", 0,
_binder_type = "fly ash", 0.0236,
_binder_type = "ggbs", 0.0125
),
cem_1_factor + binder_mod_factor*addition_percent
)
);
get_activation_time_t2_adjusted = LAMBDA(binder_type, addition_percent, placing_temp, [test_mix_temp], [rastrup_coefficient],
LET(
_rastrup_coefficient, IF(ISOMITTED(rastrup_coefficient), 12, rastrup_coefficient),
t_2, get_activation_time_t2(binder_type, addition_percent),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
adjuster, IF(placing_temp <> _test_mix_temp,
2^((_test_mix_temp - placing_temp) / _rastrup_coefficient),
1
),
t_2 * adjuster
)
);
get_ggbs_calibration_factor = LAMBDA(binder_type, addition_percent,
IF(LOWER(binder_type) = "ggbs",
1 - (0.15/75)*addition_percent,
1
)
);
get_ultimate_heat_generation_Q_41 = LAMBDA(binder_type, addition_percent,
LET(
_binder_type, LOWER(binder_type),
cem_1_factor, 352,
Q_41_standard, IFS(
_binder_type = "cem 1", cem_1_factor,
_binder_type = "fly ash", (338.4 - 2.99*addition_percent),
_binder_type = "ggbs", (338.4 - 60*(addition_percent/(100-addition_percent))^0.6)
),
// Adjustment factor described in 4.2.2 but not given, taken from spreadsheet
Q_41_adjuster, IFS(
_binder_type = "cem 1", 0,
_binder_type = "fly ash", (1 + ((cem_1_factor - 338.4)/338.4) - 0.027*addition_percent/100),
_binder_type = "ggbs", (1 + ((cem_1_factor - 338.4)/338.4)*(100 - addition_percent)/100)
),
Q_41_standard * Q_41_adjuster
)
);
get_ultimate_heat_generation_Q_ult = LAMBDA(binder_type, addition_percent,
LET(
_binder_type, LOWER(binder_type),
cem_1_factor, 352,
Q_41, get_ultimate_heat_generation_Q_41(binder_type, addition_percent),
Q_ult, Q_41 / IFS(
_binder_type = "cem 1", 0.925,
_binder_type = "fly ash", 0.925 - 0.0034*addition_percent + 0.00002*addition_percent^2,
_binder_type = "ggbs", 0.925 - 0.0047*addition_percent + 0.00003*addition_percent^2
),
Q_ult
)
);
time_adjusted_by_rastrup_function = LAMBDA(time_elapsed_hrs, concrete_placing_Temp, [test_mix_temp], [rastrup_coefficient],
LET(
_rastrup_coefficient, IF(ISOMITTED(rastrup_coefficient), 12, rastrup_coefficient),
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
adjuster, IF(placing_temp <> _test_mix_temp,
2^((_test_mix_temp - concrete_placing_Temp)/_rastrup_coefficient),
1
),
time_elapsed_hrs * adjuster
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment