Hi everybody!

I am approaching the solution of a magnetostatic problem with two different meshing strategies and one of them is not working properly having apparently “no communication” between the mesh components.

The problem is the following:

I have a vertical conductor in which is flowing a current and it should provide results close to the Biot-Savart problem (since the conductor length is much bigger than its diameter).

The first meshing strategy is summarized in the following code lines:

real lw = 2.76;

real Rw = 0.14;

border ww(t=0.,2.*pi){x=Rw*cos(t);y=Rw*sin(t);};
border bb(t=0.,2. pi){x=Rboxcos(t);y=Rbox*sin(t);label=97;};

mesh maind = buildmesh(ww(20)+bb(15));

func zgiu = -lw/2.;

func zsu = lw/2.;

mesh3 maind3D = buildlayers(maind,10,zbound=[zgiu,zsu]);

func ztop = lw;

func zmin = -lw;

//upper and lower

border bbu(t=0.,2.

*pi){x=Rbox*cos(t);y=Rbox

*sin(t);label=97;};*

mesh baseu = buildmesh(bbu(15));

border bbl(t=0.,2.sin(t);label=97;};

mesh baseu = buildmesh(bbu(15));

border bbl(t=0.,2.

*pi){x=Rbox*cos(t);y=Rboxmesh basel = buildmesh(bbu(15));

mesh3 upper = buildlayers(baseu,5,zbound=[zsu,ztop]);

mesh3 lower = buildlayers(basel,5,zbound=[zmin,zgiu]);

mesh3 MM = upper+lower+maind3D;

This first case is basically producing a big cylinder representing the “external environment” containing my vertical conductor and it is working well.

In the second case, instead of building the subvolumes that have been built previously I decided to build the conductor and separately a big cylinder and then obtaining the final mesh just summing them up, but in such a way it seems that the current that is flowing in the conductor is not causing any effect on the external environment, producing no magnetic field, as the two mesh components are not communicating at all! The code lines for the production of this second kind of mesh are the following:

//building of the “box”

func zdown = -5;

func zup = 5;

border cc(t=0.,2.*pi){x=Rbox*cos(t);y=Rbox*sin(t);label=97;};
mesh box=buildmesh(cc(2*el));

mesh3 box3D=buildlayers(box,lay,zbound=[zdown,zup]);

//building of the conductor

real lw = 2.76;

real Rw = 0.14;

border ww(t=0.,2.

*pi){x=Rw*cos(t);y=Rw*sin(t);};

mesh Thw = buildmesh(ww(30));

//extreme of the wipe

func zgiu = -lw/2.;

func zsu = lw/2.;

mesh3 Thw3D = buildlayers(Thw,20,zbound=[zgiu,zsu]);

mesh3 MM = Thw3D+box3D;

Is some of you knowing why the second meshing strategy is not working properly? And is some of you able to explain me how to make the second strategy to work? Since if the conductor geometry is getting more complicated actually the first strategy that I have mentioned it seems not to be feasable anymore.

I’m already thanking a lot everybody that will help me in solving this problem!

Best regards

Marco