The variational formulation that you need to put in the file ConvDiff.m is
u*v*dx + k*(0.1*du'*dv*dx + b(x,d,t)'*du*v*dx + g(x,d,t)*u*v*ds)
for the left-hand side and
k*(f(x,d,t)*v*dx + (g(x,d,t)*gd(x,d,t) - gn(x,d,t))*v*ds) + w*v*dx
for the right-hand side.