The theory starts by constructing an expression for free energy, A=U-TS, where internal energy U and entropy S can be calculated using mean field approximation. The grand potential is then constructed as Ω=A-μΦ, where μ is a Lagrange multiplier which equals to the chemical potential, and Φ is a constraint given by the lattice.