Phase Stability Analysis For Tight Porous Media With The Helmholtz Free Energy