Dirichlet boundary condition in heat equation

Hello fellows!

I’m trying to implement a simple bioheat problem, but I’m having trouble with the non homogeneous boundary condition.
The mesh is constructed using buildmesh and the problem is solved using varf.


real n = 200; // mesh generation parameter
    real nom = 200;
    real nbody = 160;
    real ndes = 80;
    border pml01(t=0, 0.5){x=-0.5+2*t; y=-0.5;label=1;}
    border pml02(t=0, 0.5){x=0.5; y=-0.5+2*t;label=1;}
    border pml03(t=0, 0.5){x=0.5-2*t; y=0.5;label=1;}
    border pml04(t=0, 0.5){x=-0.5; y=0.5-2*t;label=1;}
    border om01(t=0, 0.25){x=-0.25+2*t;y=-0.25;label=2;}
    border om02(t=0, 0.25){x=0.25;y=-0.25+2*t;label=2;}
    border om03(t=0, 0.25){x=0.25-2*t;y=0.25;label=2;}
    border om04(t=0, 0.25){x=-0.25;y=0.25-2*t;label=2;}

    border b(t=0, 2*pi){x=0.1*cos(t); y=0.1*sin(t); label=3;}
    border d(t=0, 2*pi){x=0.03+0.02*cos(t); y=0.03+0.02*sin(t); label=4;}
    Th = buildmesh(pml01(n)+pml02(n)+pml03(n)+pml04(n)+om04(n)+om03(n)+om02(n)+om01(n)+b(nbody)+d(ndes));


varf bioheat(T,nu) = int2d(Th)(cK*dx(T)*dx(nu)+ dy(T)*dy(nu) + cw*T*nu) + on(1,T=25);
matrix Ah = bioheat(Oh,Oh, tgv=1e43);
varf bioheatrhs(T,nu) =  int2d(Th)(cw*thbb*nu);
fc[] = bioheatrhs(0,Oh);
T[] = Ah^-1 * fc[];

Note that I’m prescribing 25º in the boundary 1, but the result is 0º when I plot the solution using medit.

Someone knows how can I solve this issue?
Thanks in advance!

Note that I’m prescribing 25º in the boundary 1

No, you are not prescribing anything on the RHS.

1 Like

You could make a smaller mesh and dump matrix and rhs to see the problem.
Why can’t you use the same varf for both? What did you expect the tgv to do?

Change these lines to:

varf bioheatrhs(T,nu) =  int2d(Th)(cw*thbb*nu) + on(1,T=25);
fc[] = bioheatrhs(0,Oh, tgv=1e43);
1 Like

It worked perfectly fine.