My plan is to solve the heat equation in the right half portion of the domain, while having the left half completely isolated with constant temperature. To do so, I model the left half with a very low conductivity. I then apply a heat flux to the top side of the right half and a Dirichlet BC to the bottom side. For the left portion, I simply apply a Dirichlet BC to the bottom side. I figured that the left portion would be untouched and with constant temperature, given its low conductivity, but it is not the case when running the code below:
from dolfin import *
mesh = UnitSquareMesh(100, 100)
V = FunctionSpace(mesh, 'CG', 1)
t, w = TrialFunction(V), TestFunction(V)
Rho = FunctionSpace(mesh, 'DG', 0)
rho = Function(Rho)
rho.interpolate(Expression("(x[0] > 0.5) + 1e-12", domain=mesh, degree=1))
File("test_rho.pvd") << rho
a = inner(rho*grad(t), grad(w))*dx
top = CompiledSubDomain("x[1] > 1 - 0.01 && x[0] >= 0.5")
bottom_right = CompiledSubDomain("x[0] >= 0.5 && x[1] < 0.01")
bottom_left = CompiledSubDomain("x[0] <= 0.5 && x[1] < 0.01")
meshfunc_ds = MeshFunction("size_t", mesh, mesh.topology().dim() - 1)
TOP, BOTTOMLEFT, BOTTOMRIGHT = 1, 2, 3
top.mark(meshfunc_ds, TOP)
bottom_left.mark(meshfunc_ds, BOTTOMLEFT)
bottom_right.mark(meshfunc_ds, BOTTOMRIGHT)
File("test_measures.pvd") << meshfunc_ds
ds = Measure("ds")(subdomain_data=meshfunc_ds)
L = Constant(5.0)*w*ds(TOP)
bc1 = DirichletBC(V, Constant(0.0), meshfunc_ds, BOTTOMRIGHT)
bc2 = DirichletBC(V, Constant(-5.0), meshfunc_ds, BOTTOMLEFT)
t_sol = Function(V)
solve(a==L, t_sol, bcs=[bc1, bc2])
File("test_temperature.pvd") << t_sol
I must not be understanding something about the heat equation. How could I obtain a constant temperature in the left half?