Monte Carlo annealing technique for the minimization of the Onsager free energy functional