3d_helmholtz_coil

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Applications > Magnetism >

3d_helmholtz_coil

Previous pageReturn to chapter overviewNext page

{  HELMHOLTZ_COIL.PDE

 

  This example shows the calculation of magnetic fields in a Helmholtz coil.

 

  -- submitted by Bill Hallbert, Honeywell

}

 

TITLE 'Helmholtz Coil'

 

COORDINATES cartesian3

 

VARIABLES    A = vector(Ax, Ay) {Magnetic Vector Potential Components}

 

DEFINITIONS

 

  { Defining parameters of the Coil }

   coil_current=200           {Amps in 1 turn}

   Lsep=6.89                   {Layer separation - cm}

   Cthick=2.36                 {Coil thickness - cm}

 

  { Regional Current Definition }

   CurrentControl=1

   Current=CurrentControl*coil_current

 

  { Circulating Current Density in Coil }

   J0=Current/Cthick^2         {A/cm^2}

   theta=atan2(y,x)

   Jx=-J0*sin(theta)

   Jy=J0*cos(theta)

 

  { Magnetic Permeability }

   m0=4*3.1415e-2             {dynes/A^2}

 

  { Coil Radii }

   Rcoil_inner=Lsep           {cm}

   Rcoil_outer=Lsep+Cthick     {cm}

   Rmax=1.5*Lsep               {cm}

 

  { Z Surfaces }

   za=2*Lsep                   {cm}

   zb=za+Cthick               {cm}

   zc=zb+Lsep                 {cm}

   zd=zc+Cthick               {cm}

   zmax=zd+2*Lsep             {cm}

   zmiddle=(zd+za)/2           {cm}

 

  { Magnetic Field }

   H=curl(A)/m0             {AT}

   Hxx = Xcomp(H)

   Hyy = Ycomp(H)

   Hzz = Zcomp(H)

 

  { Magnetic Field Error }

   Hzvec=val(Hzz,0,0,zmiddle)

   H_Error=(magnitude(H)-Hzvec)/Hzvec*100

 

EQUATIONS

   A:    div(grad(A))/m0 + vector(Jx,Jy,0) = 0

 

EXTRUSION

  Surface 'Bottom'     z = 0

      Layer 'Bottom_Air'

  Surface 'Coil1B'     z = za

      Layer 'Coil1CU'

  Surface 'Coil1T'     z = zb

      Layer 'Middle_Air'

  Surface 'Coil2B'     z = zc

      Layer 'Coil2CU'

  Surface 'Coil2T'     z = zd

      Layer 'Top_Air'

  Surface 'Top'        z = zmax

 

BOUNDARIES

  Surface "Bottom" value (Ax)=0 value (Ay)=0

  Surface "Top"   value (Ax)=0 value (Ay)=0

 

  REGION 1 'Air'

       CurrentControl=0

      start(Rmax,0) arc(center=0,0) angle =360

 

  LIMITED REGION 2 'Outer Coil'

       CurrentControl=1

      Layer 'Coil1Cu'

      Layer 'Coil2Cu'

      start(Rcoil_outer,0) arc(center=0,0) angle =360

 

  LIMITED REGION 3 'Inner Coil'

      mesh_spacing = Rcoil_inner/10

       CurrentControl=0

      Layer 'Coil1Cu'

      Layer 'Coil2Cu'

      start(Rcoil_inner,0) arc(center=0,0) angle =360

 

MONITORS

  grid(y,z) on x=0

  grid(x,y) on surface 'Coil1T'

  contour(Ax) on x=0

 

PLOTS

  grid(y,z) on x=0

  grid(x,y) on surface 'Coil1T'

  contour(Ax) on x=0

  vector(Hxx,Hyy) on surface 'Coil1T'  norm

  vector(Hyy,Hzz) on x=0  norm

  contour(magnitude(H)) on z=zmiddle

  contour(magnitude(H)) on x=0

  contour(H_Error) on Layer 'Middle_Air' on x=0

 

END