You are on page 1of 14

1

Solution of Electrostatics Problems with COMSOL

This section gives examples demonstrating how Comsol can be used to solve some simple electrostatics problems.

1.1

Laplaces Equation

We start with a solution of Laplaces equation, 2 u = 0, where u is the potential. The easiest way to solve this problem is to choose the application mode Laplaces Equation from the subsection Classical PDEs of the COMSOL Multiphysics section PDE Modes. Lets nd a solution on a square with a side length equal to 2 . To draw the square, point the cursor to the uppermost Rectangle/Square icon and left-click your mouse, while keeping the Shift key pressed. Then specify the width and height (2*pi) of the square in the popped-up window. A solution of Laplaces equation is known to be entirely determined by its boundary conditions. Therefore, go directly to the Boundary Settings, highlight, step by step, each of the four boundaries by clicking them, and let the right-hand side of the Dirichlet boundary condition r be equal to (cos(x))2 and (cos(y ))2 for the horizontal and vertical sides, respectively. Initialize and rene the mesh (the triangle symbols on the main (upper) icon bar) and, nally, hit the equal sign to nd a solution. The resulting distribution of u in the square is shown in the upper panel of Fig. 1. This distribution can be exported to a text le. Such a le has been used to produce the plot in the lower panel with the help of another graphical software. This plot demonstrates one of the main properties of solutions of Laplaces equation: they tolerate no local maxima or minima, extreme values of u occur only at the boundary.

1.2

Elementary Point Charge

In the second example, the electric eld of an elementary charge Q0 is computed. Although Comsol can model point charges, we prefer to consider the elementary charge uniformly distributed over a small spherical volume V0 , so that the charge density is equal to Q0 /V0 inside and zero outside the sphere, where Q0 = 1.602 1019 C. To produce a spherical domain, we have to use the 2D space dimension for axial symmetry, in which Comsol employs the cylindrical coordinates (r, z, ). Here, 3 the sphere is represented by a circle of the radius r0 , such that V0 = 4r0 /3. Note that the parameters Q0 , r0 , and V0 and their values can be specied as Constants in a special table, after which their names can be used everywhere in the current model. To be able to see how the eld looks outside the sphere, we surround our small charged sphere by another concentric sphere of a much larger radius. Like the square in the rst example, the circles can easily be drawn by clicking the Ellipse/Circle (Centered) icon, while keeping the Shift key pressed, and entering necessary radii in the popped-up window. To compute the electric eld, we solve Poissons equation for the potential V in the Electrostatics application mode of the COMSOL Multiphysics/Electromagnetics section. In the Subdomain Settings, we specify the

values of in our two subdomains (the charged small sphere and empty large sphere) and the value of r = 1 for the relative permittivity in either of them. In the Boundary Settings, we choose the Ground and Continuity conditions for the outer and inner spheres, respectively. The nal two steps are to mesh the subdomains and solve the problem. The upper panel of Fig. 2 presents the solution in a form that can be customized using a number of options in the Postprocessing section. It is convenient that the Comsol solution contains not only the dependent variable (the potential V in the present case) but also its various derivatives. One of such derivatives gives the radial (in the cylindrical coordinates) component of the electric eld Er . Its ratio to the respective expression from Coulombs law is plotted in the lower panel for z = 0. The lower plot is obtained using the option Line/Extrusion of the Cross-Section plot Parameters section in Postprocessing. You can play with dierent postprocessing options to gure out what they do or you can read the COMSOL Multiphysics Users Guide that is downloaded as a web page with other Comsol reference pages when you click the button Help, wherever you see it.

1.3

Electric Dipole

The third example is an electric dipole consisting of two opposite elementary charges uniformly distributed over two small spheres that are separated by a specied distance. This problem is similar to the previous one, therefore it can be used as an exercise. Its solution is shown in Fig. 3.

1.4

Faradays Cage

The fourth example is a model of Faradays cage, i.e. an enclosure made of a conducting material (e.g., steel) placed in a strong external electric eld. It shows that the Faraday cage blocks out the external static electric eld, like a shield. We use the 2D space dimension that employs Cartesian coordinates (x, y, z ). In the XY-plane of the screen the enclosure is represented by a square with sides of a nite thickness (to obtain it, draw two squares with slightly dierent side lengths, highlight both of them by pressing Ctrl-A, and click the icon Difference that will subtract the smaller square from the larger one. Outline the enclosure by a square of a larger radius. In the Boundary Settings, prescribe the upper side of the large square a high potential, e.g. V = 1000 V, and let its lower side be at Ground (V = 0). The left and right sides of the large square should be in Electric insulation. All sides of the enclosure are subject to the Continuity interior boundary conditions. In the Subdomain Settings, we leave all the standard settings, except the electric conductivity of the enclosure walls for which we use the value of = 4.032 106 [S/m] for steel. The nal two steps are to mesh the subdomains and solve the problem, as usually. The resulting distribution of the electric eld and potential are shown in Fig. 4. We see that the strong external eld does not penetrate the enclosure, therefore it is actually safe to be in a car (not a convertible though!) during a thunderstorm.

1.5

Electric Sensor

The nal electrostatics example is based on one of the pre-tested models supplied with the COMSOL package. This is a model of electric sensor, the original version of which can be found in the COMSOL Multiphysics/Electromagnetics section of the Model Library. The electric sensor is a box inside of which there are objects of dierent forms with dierent relative permittivities (in this example, the hidden objects are the letters UVic with the permittivities 2, 3, 4, and 5, respectively). The objects do not touch the lower and upper boundaries of the box. The lower boundary is grounded (V = 0), while the upper boundary has the potential V = 1 V. The resulting potential dierence produces an electric eld directed from the upper to lower boundary that induces a surface charge on the boundaries. The surface charge density depends on the permittivity and form of the objects that are encountered by the electric eld on its way in the box (Fig. 5). This allows us to see the boxs content through its boundaries.

Solution of Magnetostatics Problems with COMSOL

This section presents three examples of magnetostatics problems that are solved using pre-tested models from Comsols Model Library. They are followed by a description of our original Comsol model designed to simulate a small puck magnet falling through a long copper tube.

2.1

Eddy Currents

The rst example is a tutorial model of eddy currents (the blue region in Fig. 6) induced in a metallic cylinder by an alternating current in a surrounding coil. Only a cross-section of the coil wire is shown in the gure (the red circle). It is seen that the current in the cylinder has a direction opposite to that of the current in the coil (the blue and red colors, respectively). This is a consequence of the well-known general rule saying that (eddy) currents generated in a conductor by a varying magnetic ux (in the present example, it is produced by the alternating current) have such orientation and strength that their associated magnetic eld counteracts the ux change that has caused their generation. The distribution of the current density in the coil (the current is stronger near the surface of the wire) demonstrates the so-called skin eect in a conductor with an alternating current a shift of the current toward the conductors surface, which is also caused by eddy currents but now in the coil. This problem is solved in the 2D axisymmetric geometry. Streamlines of the magnetic eld are also shown.

2.2

Magnetic Brake

A magnet brake in its simplest form consists of a disk of conductive material and a permanent magnet (upper-left panel in Fig. 7). The magnet produces a constant magnetic eld B0 , in which the disk is rotating. When the conductive disk moves through the magnetic eld, the changing magnetic ux induces eddy currents in it, and the Lorentz force (more precisely, its associated integrated torque) resulting from the interaction between the currents and magnetic eld brakes the disk. The upperright panel of Fig. 7 shows how the disks angular velocity decreases with time. The rotation that starts with 200 revolutions per second completely stops in just 8 seconds for B0 = 0.1 T. The lower panels show how the magnetic eld B in the disk decays as the rotation slows down (note the dierence in the color-bar B scales between the left and right panels). White arrows show the distribution of the normalized current density in the disk.

2.3

Magnetic Quadrupole Lens

Just like optical lenses focus light, electric and magnetic lenses can focus beams of charged particles. Systems of magnetic quadrupole lenses nd a common use in focusing both ion and particle beams in accelerators at nuclear and particle physics centers, such as CERN, SLAC, and others. Fig. 8 shows a simple Comsol model of the magnetic quadrupole lens (upper panel) and the path of B5+ ions going through three consecutive magnetic quadrupole lenses (lower panel). The model is set up in a cross section of the geometry. The quadrupole consists of an assembly of four permanent magnets, where the magnets work together to give a good approximation of a quadrupole eld. To strengthen the eld and keep it contained within the system, the magnets are set in an iron cylinder. The ions are sent through a system of three consecutive quadrupole assemblies. The middle one is twice as long as the other ones, and is rotated by 90 degrees around the central axis. This means the polarity of its magnets is reversed. The color map and contour lines in the upper panel show the magnetic eld conguration in a cross section of the rst and third quadrupoles. The central part of the lower-panel plot shows projections of particle tracks onto the screen plane (XOY) as the particles move through the three consecutive quadrupoles in the Z direction (perpendicular to the screen). Initially, when they enter the rst quadrupole, the particles are assumed to be evenly distributed along the white circumference. While traveling through the rst quadrupole, the particles get focused along the X axis and de-focused along the Y axis (green portions of the tracks). The second quadrupole has a reverse magnetic eld, therefore the particles farthermost from the Y axis are rapidly getting focused along the Y axis (blue portions of the tracks). Finally, the third quadrupole stabilizes their motion directed toward the Y axis, and all the particles are now focused inside the central circumference of smaller radius (red portions of the tracks).

2.4

Puck Magnet Falling Through the Copper Tube

In our simple experiment, we drop a small puck magnet into a vertically held copper tube. The tube has the length L 0.412 m. Surprisingly, it takes as many as t 4.20 s for the puck magnet to appear at the bottom opening of the tube. For comparison, a free fall of the magnet from the height of L would take only t = 2L/g = 0.290 s, which is 14.5 times less than in our experiment! This huge dierence is evidently caused by eddy currents that are induced in the copper tube by magnetic ux changes arising from the motion of the magnet. Interaction of these currents with the magnetic eld produces the Lorentz force that slows down the magnets fall. This problem can easily be modeled with the COMSOL Multiphysics standard application mode Magnetostatics. It has an appropriate equation template in which we should substitute a few parameters from our experiment. These are the average velocity of the tube relative to the magnet, vz = L/t = 9.81 102 m/s, the electric conductivity of copper, = 5.998 107 S/m, and a reasonable test value for the magnetization of the puck magnet, e.g. Mz = 106 A/m. According to our measurements, the puck magnet has the diameter of 0.008 m and the height of 0.003 m. The tubes inner cross section has the diameter of 0.01 m, while its walls are approximately 0.001 m thick. It is convenient to use the 2D space dimension for axial symmetry to draw the parts of our experiment. For the Z axis directed up, the cross sections of the magnet and tube, as well as a region surrounding them, are represented by rectangles (upper panel in Fig. 9). Boundary Settings should be Magnetic insulation for the external boundary and Continuity for the internal boundaries. Subdomain Settings are done in the equation template, the latter containing enough information for one to understand where to put each of the parameters (of course, the constitutive relation with the magnetization term should be selected for the magnet). It is instructive to nd out rst how the Lorentz force Fz depends on the tube velocity vz . To do this, the Parametric Solver has to be chosen in the Solver section, and the name of the parameter (vz ) and a desired range of its values (e.g., range(0.0,0.02,0.2)) have to be specied. After the solver has nished its work, we should go to Postprocessing/Subdomain Integration, highlight (by clicking it) the right cross section of the tube (do not highlight its other side!), and ask Comsol to compute a volume integral of the Lorentz force, tube Fz dV , (click Apply). To produce a gure with a curve showing the dependence of tube Fz dV on vz , like the one in the middle panel of Fig. 9, click the button Plot. The main result is that the integrated Lorentz force turns out to be proportional to the velocity of the magnet. From here on, it is straightforward to write down the equation of motion, solve it, and gure out that we can estimate the magnetization (and, hence, the magnetic eld) of the puck magnet in our experiment if we will carry out another parametric study to determine a dependence of the volume integral of Fz /m on Mz (lower panel in Fig. 9), where m = 2.938 103 kg is the mass of the puck magnet.

Figure 1: A solution of Laplaces equation.

Figure 2: Electric eld of an elementary point charge.

Figure 3: Electric eld of a dipole.

Figure 4: Simple Faradays cage.

Figure 5: Electric sensor.

10

Figure 6: Eddy currents and the skin eect.

11

Figure 7: A simple magnetic brake.

12

Figure 8: Focusing of a beam of charged particles by quadrupole magnetic lenses.

13

Figure 9: A puck magnet falling through a copper tube.

14

You might also like