Periodic boundary conditions in a composed domain

Hello everyone,

I’m trying to define periodic boundary conditions on a cubic domain decomposed in two regions. In the paralell faces(labels [1,2], [3,4], [5,6]) were imposed identical boudary conditions. In the interface(label 7) was assumed as free.

load “msh3” load “iovtk” load “gmsh” load “MUMPS_seq”

/*
LABELS

FRONT 1
BACK 2
LEFT 3
RIGHT 4
TOP 5
BOTTOM 6
INTERFACE 7

*/

mesh3 cellunit=readmesh3(“Unitcell.mesh”);

savemesh(cellunit,“total.mesh”);

plot(cellunit);

func perio=[[1,x,z],[3,x,z],[2,y,z],[4,y,z],[5,x,y],[6,x,y]];

real Ce0=1.73e4;
real k1=0.003;
real k2=0.002;
real n=0.2;
real D=1.41e-14;

real l=0.5;
real Free=1;
real Symmetry=2;

fespace Vh(cellunit,P1, periodic=perio);
fespace Ph(cellunit,P0);

However when I execute the problem, I get the following error:

Exec error : Periodic 3d: the both number of face is not the same.

Below you have attached the .edp and the .mesh file.
Test.edp (534 Bytes)

Unitcell.mesh

Periodic 3d: the both number of face is not the same

Any suggestion will be very appreciated.
Best Regards
Jacob

Hello Jacob,

I stumbled upon your post while searching for a solution to this problem, I too have a unit cell with an interface (two intersecting cylinders) and I need to define periodic boundary on the faces of the cube while the interface is left free. The error you’re getting, i believe, is the same for the 2d case when the identified boundaries are not the same (same number of vertices and same location of the vertices with respect to periodicity variable). I remember reading that it is so important for the boundaries to remain the same, that FreeFem developpers made an option for keeping the boundaries unchanged, when remeshing (I know it exists for the 2d case, I don’t know if it’s true for 3d).
So, I believe the problem is to make sure the faces are the same, which is complicated if your interfaces touche the borders, but should be feasible nonetheless. Have you managed to find a solution?

Sincerly yours,
Salah

2 Likes

Hello Salah,

Sorry for the delay. As you said it has to be a correspondence between the number of faces. I adjusted the mesh to make it equal in triangle number and, effectively, I did solve the problem. Regarding to the remeshing tool you mentioned, could you say to me where can i find it?. It would be an easier way to create periodic meshes without doing it manually in gmsh.

Thank you very much

Best Regards,
Jacob