ComPhys

@comphys
1 Followers
4 Following
13 Posts

I post physics calculations and open source software related to physics; mostly FEniCS at the moment.

https://comphysblog.wordpress.com

3D electrostatics example using #FEniCS. In this example I solve the Laplace equation for two concentric spheres to obtain an electric potential and take the gradient to find the electric field. The results are then compared with an analytical solution.

The geometry is produced in FreeCAD and the mesh/ boundaries produced with Gmsh.

https://comphysblog.wordpress.com/2018/08/26/3d-electrostatics-using-fenics/

Please let me know if you have comments or corrections!

#physics #opensource

3D Electrostatics using FEniCS

Physics & Computers

All of the examples I've posted so far (and that I'm writing) are based on the Laplace equation: specify known voltages, and solve for no sources. This is a very useful technique.

Sometimes it is more useful to specify a charge distribution. To achieve this in #FEniCS we can make use of subdomains and/ or expressions. I'll be starting a post on solving for relatively arbitrary charge distributions. (Just got an example working myself).

#opensource #python #physics #electomagnetism

To run a #Jupyter notebook with a #FEniCS docker container just use the commands:

fenicsproject notebook [name]
fenicsproject start [name]

The output of this command will tell you a port to use for matplotlib plots (mine are always between 3000 and 4000). In your web browser visit

127.0.0.1:[matplotlibport]

and you should get the usual jupyter window!

Here's a video showing how to make a 2D coaxial geometry in gmsh, refine the mesh, specify a subdomain and boundaries ready to be imported into #FEniCS

In my blog post this geometry is then used for finding an electrostatic field using the finite element method with #FEniCS.

https://comphysblog.wordpress.com/2018/08/15/fenics-2d-electrostatics-with-imported-mesh-and-boundaries/

#physics #opensource #python

FEniCS – 2D Electrostatics with Imported Mesh and Boundaries

Physics & Computers

Simple 2D electrostatics using the open source finite element solver Fenics, with a geometry imported from gmsh.

Please send any comments, questions, corrections or requests.

https://comphysblog.wordpress.com/2018/08/15/fenics-2d-electrostatics-with-imported-mesh-and-boundaries/

Future posts: 3D electrostatics using FreeCAD, magnetostatics, electric materials and TEM properties.

#physics #fea #opensource #fem

FEniCS – 2D Electrostatics with Imported Mesh and Boundaries

Physics & Computers