Magnetohydrodynamic models of solar coronal magnetic fields