This thesis describes work on building numerical models of the Earth's magnetosphere using magnetohydrodynamics (MHD) and other related modeling methods. For many years, models that solve the MHD equations have been the main tool for improving our theoretical understanding of the large-scale dynamics of the Earth's magnetosphere. While the MHD models have been very successful in capturing many large-scale features, they fail to adequately represent the important drift physics in the inner magnetosphere. Consequently, the ring current, which contains most of the particle energy in the inner magnetosphere, is not realistically represented in MHD models. In this thesis, Chapter 2 and 3 will describe in detail our effort to couple the OpenGGCM (Open Geospace General Circulation Model), one of the major MHD models, to the Rice Convection Model (RCM), an inner magnetosphere ring current model, with the goal of including energy dependent drift physics into the MHD model. In Chapter 4, we will describe an initial attempt to use a direct-integration method to calculate Birkeland currents in the MHD code. Another focus of the thesis work, presented in Chapter 5, addresses a longstanding problem on how a geomagnetic substorm can occur within the closed field line region of the tail. We find a scenario of a bubble-blob pair formation in an OpenGGCM simulation just before the expansion phase of the substorm begins and the subsequent separation of the bubble and the blob decreases the normal component of the magnetic field until finally an X-line occurs. Thus the formation of the bubble-blob pair may play an important role in changing the magnetospheric configuration from a stretched field to the X-line formation that is believed to be the major signature of a substorm.