2D Magnetostatics – cos(φ) Dipole Magnet

In this post I'll demonstrate how to find the magnetic field of steady currents with FEniCS. I'll start this with a simple example of a coaxial conductor with a uniform current, before moving onto the more interesting example of a cos(φ) magnet of the sort used in particle accelerators like the LHC. I'll include linear… Continue reading 2D Magnetostatics – cos(φ) Dipole Magnet

Electrostatics with Non-Uniform Charge Densities

In a previous post I demonstrated how to simulate electrostatic problems with uniform charge densities within a region, this post will generalise that to include charge densities which depend on position. This could be useful to simulate something like a particle beam, which could never really be uniformly distributed. To demonstrate this a Gaussian charge… Continue reading Electrostatics with Non-Uniform Charge Densities

Assuming Symmetry with Boundary Conditions

Some of the examples so far have symmetries which, if properly exploited, could reduce the size of the simulated geometry, and an improved mesh density should provide a more accurate solution. Alternatively these techniques could be used to reduce the computational resources required to solve a problem. In this example I will re-visit the TEM… Continue reading Assuming Symmetry with Boundary Conditions

Electrostatics with Linear Dielectric Materials using FEniCS

Articles thus far relating to the topic of electrostatics, have made the simplification that all space within the problem was homogeneous and isotropic. In this post I will introduce a technique to include linear dielectrics of arbitrary shape, and thus to do away with this simplification. The technique itself is simple, and requires only that… Continue reading Electrostatics with Linear Dielectric Materials using FEniCS

Electrostatics with Charge Densities in FEniCS

Previous posts have found the electrostatic fields from the Laplace equation with the electric potentials specified on boundaries which are considered to be perfect conductors. In this post a uniform charge density will be specified and the resulting fields calculated. This will be done using a FEniCS subdomain, giving the charge distribution a hard edge,… Continue reading Electrostatics with Charge Densities in FEniCS

TEM Mode Analysis with FEniCS

Contents 1 - Introduction 2 - Geometry, Mesh and Boundaries 3 - Calculations and Results 3.1 - Electric Potential and Field 3.1.1 - Analytical Solution 3.1.2 - FEniCS Solution 3.1.3 - Comparison 3.2 - Magnetic Field 3.2.1 - Analytical Solution 3.2.2 - FEniCS Solution 3.2.3 - Comparison 3.3 - Current and Characteristic Impedance 3.3.1 -… Continue reading TEM Mode Analysis with FEniCS

3D Electrostatics using FEniCS

  FEniCS is an open source general purpose finite element solver. That means it incredibly general but also not as easy to start with as commercial finite element solvers; which are often tailored for specific applications. The purpose of the FEniCS electrostatics posts is to demonstrate how FEniCS can be used to solve electrostatics problems… Continue reading 3D Electrostatics using FEniCS

FEniCS – 2D Electrostatics with Imported Mesh and Boundaries

pIn the previous post the Laplace equation was solved between two infinite parallel plates subject to certain boundary conditions using FEniCS. That particular geometry was chosen for two reasons; first was because it is a simple problem for which there is a well known analytical formula and second because it allowed the mesh to be… Continue reading FEniCS – 2D Electrostatics with Imported Mesh and Boundaries

FEniCS – Simple 2D Electrostatic Boundary Value Problems

Introduction and Background The electric field of any static charge distribution can be computed using Coulombs law, however this is not always practical as the integrals which have to be solved can be very complicated. For this reason we often solve Gauss's law, which can be derived from Coulombs law (or vice versa). The differential… Continue reading FEniCS – Simple 2D Electrostatic Boundary Value Problems