xmpl2d44.dat, converting an electric field to a magnetic field.

Here we deal with the magnetic circuit of an x-ray tube, as an example of the procedure given in the link on converting.  There is some overlap in information.


There are some similarities between electrostatic and magnetostatic fields -Laplace's equation is essentially the same. Under some conditions it is therefore possible to consider the electrical charges as magnetic monopoles and to regard the fields calculated by the CPO programs as magnetic fields. These fields can then be put in the output file as a grid of values, and after appropriate scaling these could become the input to a User-supplied magnetic field routine in an electrostatics calculation.

The procedure is as follows:

Suppose that the number of ampere-turns is NI. 

Use CPO2D or CPO3D to model the pole pieces and the neighbouring parts of the 

magnetic circuit. 

Apply a potential difference across the gap of dV = 0.00125664 (=4*pi*0.0001, see below), which corresponds to 1 amper-turn. 

Then output the fields into the output file (as described below). 

Then use this file as the magnetic data file for CPO3D. 

Finally use the CPO3D databuilder to scale the field, using NI as the scaling factor.

The present simulation deals with the magnetic circuit of an x-ray tube. The geometry is over-simplied and the external parts of the circuit have been omitted.

The databuilder option contours/field/grid has been used, with r from 0 to 2 in 5 steps and z from -10 to 50 in 121 steps. The output file then contains:

   r, z, er, ez (V/mm):

  0.0000E+00 -1.0000E+01  0.0000E+00  1.8423E-05

  0.0000E+00 -9.5000E+00  0.0000E+00  1.8597E-05

  0.0000E+00 -9.0000E+00  0.0000E+00  1.8761E-05

  0.0000E+00 -8.5000E+00  0.0000E+00  1.8913E-05

  0.0000E+00 -8.0000E+00  0.0000E+00  1.9053E-05

 etc, etc.

We then change the first few lines, to turn this output file into the format required for a User-supplied incomplete 2D grid of magnetic field points. The file is then:

 0. 2. minimum r, maximum r

 -10. 50. minimum z, maximum z

 605 0.5 n_total , spacing

 0.0000E+00 -1.0000E+01 0.0000E+00 1.8423E-05

 0.0000E+00 -9.5000E+00 0.0000E+00 1.8597E-05

 0.0000E+00 -9.0000E+00 0.0000E+00 1.8761E-05

 0.0000E+00 -8.5000E+00 0.0000E+00 1.8913E-05

 0.0000E+00 -8.0000E+00 0.0000E+00 1.9053E-05

 etc, etc.

This file can then be used as an input file in CPO3D, using the option for a User-supplied incomplete 2D grid of points. CPO3D will interpolate between the points to evaluate the components of the 3D magnetic field, unless the coordinates are outside the given range, in which case the field will be set to zero.

The name of the file is entered in databuilder.

The given field is that for one ampere-turn, so therefore the scaling factor entered in databuilder should be the number of ampere-turns, NI.