Magnetic field thin wire


I’m trying to compute the magnetic field from a thin wire following this example Using BBND to compute the magnetic field of a thin wire

I get this warning when running the solver:

used dof inconsistency
(silence this warning by setting BilinearForm(…check_unused=False) )

Anyone that can see what I’m missing in the code? The code is attached.

square-coil-wire.ipynb (5.3 KB)

you can create the mesh now easier with netgen-occ:

square = WorkPlane().RectangleC(0.5,0.5).Face() = "wire"
square.edges.Max(Y).name = "contact"

sphere = Sphere((0,0,0), 1) = "outer" = "air"

shape = Glue([sphere, square])
geo = OCCGeometry(shape)
mesh = Mesh(geo.GenerateMesh(maxh=0.2))

Think this should resolve this error.

Thanks! I just tried it and it works. :slight_smile: File attached.
square-coil-wire-occ.ipynb (9.1 KB)

1 Like