def f_tr_Haaland(Re_D, ɛ, D, warn=True):
if warn:<EOL><INDENT>try:<EOL><INDENT>if (ɛ / D) < <NUM_LIT:0.0> or (ɛ / D) > <NUM_LIT>:<EOL><INDENT>raise Warning(<EOL>f"<STR_LIT>")<EOL><DEDENT><DEDENT>except Warning as w:<EOL><INDENT>ex_type, ex_value, ex_traceback = sys.exc_info()<EOL>print(color_warn("<STR_LIT>"), ex_value)<EOL><DEDENT>try:<EOL><INDENT>if Re_D < <NUM_LIT> or Re_D > <NUM_LIT>:<EOL><INDENT>raise Warning(<EOL>f"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>except Warning as w:<EOL><INDENT>ex_type, ex_value, ex_traceback = sys.exc_info()<EOL>print(color_warn("<STR_LIT>"), ex_value)<EOL><DEDENT><DEDENT>return <NUM_LIT:1> / (<NUM_LIT> * log10((<NUM_LIT> / Re_D) + (ɛ / D / <NUM_LIT>)**<NUM_LIT>))**<NUM_LIT:2><EOL>
Calculate the friction factor of turbulent flow (t) in a rough duct (r) for
the provided conditions with Haaland's equation.

:param Re_D: Reynolds number for the specified hydraulic diameter.
:param ɛ: [m] Surface roughness.
:param D: [m] Duct hydraulic diameter.
:return: Friction factor.

Source: lienhard2018, Eq. 7.50.