Set non-constant boundary condition proportional to solution at that point and time
4 views (last 30 days)
I'm attempting to model diffusion from a 3D geometry using PDE Toolbox. I have set up a cylinder and wish for diffusion to occur at a rate proportional to the concentration at that point. I have specified the following:
%Apply F1 rate of flux = 0
%Apply F2 rate of flux = 3e-6 mol/m2/s = 3e-24 mol/nm2/s
%Apply F3 rate of exit = 3e-6 mol/m2/s = 3e-24 mol/nm2/s
tlist = 0:1e8:1e9;
solution = solvepde(model,tlist);
sol = solution.NodalSolution;
function bcMatrix = myfunc(location,state)
bcMatrix = R*state.u
I was hoping to set my Neumann boundary condition 'g' parameter equal to some constant R multiplied by the concentration on that boundary at that point. I read the forums trying to find an answer but couldn't find one!
I have been trying to model this for hours!! Please help!!