What version of Gurobi.jl do you have installed? Try updating to the latest version, we recently fixed a performance issue that is probably causing this.
I would probably do something like this:
# @expression(model, W[a in sets[:A], n in sets[:E]], sum(Y[a, n, br] for br in sets[:F][var_1]))
@variable(model, W[a in sets[:A], n in sets[:E]])
@constraint(
model,
[a in sets[:A], n in sets[:E]],
W[a, n] == sum(Y[a, n, br] for br in sets[:F][var_1]),
)
@constraint(
model,
U[a in sets[:A], b in var_6, t in sets[:D]],
sum(Z[a, i, j, b, t] for i in sets[:B][var_1], j in sets[:C][i] if b in sets[:G][j]) == 0,
)
calculated_parameter = 0.5
for a in sets[:A], t in sets[:D]
set_normalized_coefficient(model[:U][a, 1, t], W[a, :a], -calculated_parameter)
end
where you introduce a new variable to represent the expression, and then you modify the coefficient of that variable in the relevant constraints.