$$ \def\ab{\boldsymbol{a}} \def\bb{\boldsymbol{b}} \def\cb{\boldsymbol{c}} \def\db{\boldsymbol{d}} \def\eb{\boldsymbol{e}} \def\fb{\boldsymbol{f}} \def\gb{\boldsymbol{g}} \def\hb{\boldsymbol{h}} \def\kb{\boldsymbol{k}} \def\nb{\boldsymbol{n}} \def\pb{\boldsymbol{p}} \def\qb{\boldsymbol{q}} \def\rb{\boldsymbol{r}} \def\tb{\boldsymbol{t}} \def\ub{\boldsymbol{u}} \def\vb{\boldsymbol{v}} \def\xb{\boldsymbol{x}} \def\yb{\boldsymbol{y}} \def\zb{\boldsymbol{z}} \def\Ab{\boldsymbol{A}} \def\Bb{\boldsymbol{B}} \def\Eb{\boldsymbol{E}} \def\Fb{\boldsymbol{F}} \def\Jb{\boldsymbol{J}} \def\Ub{\boldsymbol{U}} \def\xib{\boldsymbol{\xi}} \def\evx{\boldsymbol{e}_x} \def\evy{\boldsymbol{e}_y} \def\evz{\boldsymbol{e}_z} \def\evr{\boldsymbol{e}_r} \def\evt{\boldsymbol{e}_\theta} \def\evp{\boldsymbol{e}_r} \def\evf{\boldsymbol{e}_\phi} \def\evb{\boldsymbol{e}_\parallel} \def\omb{\boldsymbol{\omega}} \def\dA{\;\mathrm{d}\Ab} \def\dS{\;\mathrm{d}\boldsymbol{S}} \def\dV{\;\mathrm{d}V} \def\dl{\mathrm{d}\boldsymbol{l}} \def\bfzero{\boldsymbol{0}} \def\Rey{\mathrm{Re}} \def\Real{\mathbb{R}} \def\grad{\boldsymbol\nabla} \newcommand{\dds}[1]{\frac{\mathrm{d}{#1}}{\mathrm{d}s}} \newcommand{\ddy}[2]{\frac{\partial{#1}}{\partial{#2}}} \newcommand{\ddt}[1]{\frac{\mathrm{d}{#1}}{\mathrm{d}t}} \newcommand{\DDt}[1]{\frac{\mathrm{D}{#1}}{\mathrm{D}t}} $$
Boundary conditions for potential field extrapolation
I’ve recently updated my spherical PFSS solver to add a new alternative outer boundary condition on the source surface \(r=R_{\rm ss}.\) In addition to the usual “radial field” condition \(B_\theta=B_\phi=0,\) it is now possible to match \(B_r(\theta,\phi)\) to an arbitrary two-dimensional distribution.
This is useful, for example, in studies of magnetic helicity.
The images below show two potential-field extrapolations from the same \(B_r\) on the lower boundary, one using the original radial-field condition and the other with the new outer boundary condition. In this case, I matched the outer \(B_r\) to a non-potential field from a magneto-frictional model. Notice how this new boundary condition allows “u-loops” in the potential field.
My code is based on the method described in Appendix B of van Ballegooijen et al (2000), and the modification to the new boundary condition was quite straightforward. Instead of using equation (B9) to relate \(C^{(-)}_{lm}\) and \(C^{(+)}_{lm},\) we use orthogonality of the eigenmodes twice, at the inner and outer boundaries. This gives two simultaneous equations for \(C^{(-)}_{lm}, C^{(+)}_{lm}\) which are just solved algebraically. See the manual of my code for more details.
The advantage of the van Ballegooijen method over (say) spherical harmonics is that \(\nabla\times{\bf B}={\bf 0}\) is satisfied to high accuracy when using a particular finite-difference stencil. This is important when using the solution to initialise magneto-frictional simulations, for example.
Finally, I note that David Stansby at Imperial has recently packaged my solver with a bit more of a user interface – see here.