Development and Application of Variational Methods for Simulation of Miscible Displacement in Porous Media