  Measurements of the interplanetary magnetic field (IMF) over several solar
cycles do not agree with computed values of open magnetic flux from potential
field extrapolations. The discrepancy becomes greater around solar maximum in
each cycle, when the IMF can be twice as strong as predicted by the potential
field model. Here we demonstrate that this discrepancy may be resolved by
allowing for electric currents in the low corona (below 2.5 solar radii). We
present a quasi-static numerical model of the large-scale coronal magnetic
evolution, which systematically produces these currents through flux emergence
and shearing by surface motions. The open flux is increased by 75%-85% at solar
maximum, but only 25% at solar minimum, bringing it in line with estimates from
IMF measurements. The additional open flux in the non-potential model arises
through inflation of the magnetic field by electric currents, with
super-imposed fluctuations due to coronal mass ejections. The latter are
modelled by the self-consistent ejection of twisted magnetic flux ropes.
