I want to model the following phenomena:
two bodies with thickness d made of the same material A with the same conductivity k are separated with a very thin (delta << d) plate from material B with a very high conductivity (k2 >> k). To reduce the computational burden of meshing the plate, it is treated as a 2-dimensional surface and is introduced to the weak form as int2d(plate) k2 delta nabla_t u nabla_t v
, where nabla_t is 2D gradient in the plate’s plane (not to confuse with a directional derivative notation).
Everything works well, but I have a problem with Robin’s/Neumann’s boundary condition. If I introduce the BC in a standard way. (int2d(gamma_N) v*q
), the flux will be imposed only on the surface of material A, and effectively there will be a no-flux condition at the boundary of material B (*). The flux at the B’s boundary can have a crucial effect on the phenomena, so I would like to control it.
Is it possible from the FEM and FreeFEM perspective to introduce the flux on such a boundary?
From the mathematical perspective on a rectangular domain, int2d f(x) dxdy = deltay int1d f(x)dx, so theoretically I could introduce delta int1d(plate) v q, but int1d
is not accepted in 3D formulation by FreeFEM, so I am looking for other solutions.
The following MRE script is what I am working on currently:
load "gmsh"
load "msh3"
mesh3 Th=gmshload3("cube.msh");
fespace Vh(Th, P2);
Vh u, v;
real k = 1;
real kratio = 1000;
real k2 = kratio*k;
real delta = 0.01;
real q=100;
macro grad(u) [dx(u), dy(u), dz(u)]//EOM
solve Laplace(u, v)
= int3d(Th)(
k*( grad(u)'*grad(v) )//'
)
+ int2d(Th,2)( //thin plate effect
k2*delta*(dx(u)*dx(v)+dy(u)*dy(v))
)
- int2d(Th,3)( //Neumann BC at inlet
v*q
)
+ on(5, u=0) //Dirichlet BC at outlet
;
plot(u, wait=true, nbiso=10, value=true);
//Flux calculations
meshL ThL = Sline(100);
real xmin = 0;
real xmax = 1;
real ymin = 0;
real ymax = ymin;
real zmin = 0.5;
real zmax = zmin;
meshL ThL1=movemesh(ThL, [x*(xmax-xmin)+xmin,x*(ymax-ymin)+ymin,x*(zmax-zmin)+zmin]);
meshL ThL2=movemesh(ThL, [x*(xmax-xmin)+xmin,x*(ymax-ymin)+ymin+1,x*(zmax-zmin)+zmin]);
fespace VhL1(ThL1, P2);
fespace VhL2(ThL2, P2);
VhL1 ul1;
VhL2 ul2;
real fluxIn = -int2d(Th,3)(k*dy(u)) ;//'
real fluxOut = -int2d(Th,5)(k*([dx(u), dy(u), dz(u)])'*[N.x,N.y, N.z]) ;//'
real fluxInL = -int1d(ThL1)(k2*delta*dy(u));
real fluxOutL = -int1d(ThL2)(k2*delta*dy(u));
cout<<"\nFlux in: "<<fluxIn<<", "<<fluxInL<<", sum: "<<fluxIn+fluxInL<<"\nFlux out: "<<fluxOut<<", "<<fluxOutL<<", sum: "<<fluxOut+fluxOutL<<"\n\n";
The mesh file:
https://mega.nz/file/SvZRgTBa#_RnDooT0YIIdpq8bIfncfaKIcN83vZue1TLCaHbQpDw
Labels: 3 - inlet, 5 - outlet, 100 - line at inlet, 101 - line at outlet, 2 - plate surface
(*) In the following script, there is a flux associated with the boundary, but it is correctly approaching 0 when increasing the mesh density