setting generalised Neumann boundary conditions in pdetoolbox when c is not 1

4 views (last 30 days)
I have a rectangle with no flux on two sides and flux proportional to concentration on the other two sides. (I am modelling diffusion in a cylindrical well with some loss). I have set the boundary condition matrix to
1 1 1 1
0 0 0 0
3 3 1 1
1 1 1 1
46 46 48 48
48 48 48 48
49 49 48 48
48 48 48 48
so that q is 0 on two sides and .01 on the other two. g is 0 always.
But my PDE equation has d = x, c = x, a = 0 and f = 0 in the PDEtoolbox format. and the boundary condition equation has n*c*grad(u) + qu = g. So should I be dividing q by x in the boundary condition matrix?

Answers (1)

Bill Greene
Bill Greene on 5 Aug 2013
Edited: Bill Greene on 5 Aug 2013
Hi,
If I understand your BC correctly,
>flux proportional to concentration
you would like to set n*c*grad(u) (flux through the boundary) equal -.01*u?
Basically, PDE Toolbox "knows" the value of flux on an edge because you have specified the particular edge in defining your BC. So, as long as your definition of flux is the same as PDE Toolbox (i.e. n*c*grad(u)), you don't need to divide by c.
If I misundersood the question, let me know and I'll try again ;-)
Bill
  2 Comments
Sarah
Sarah on 5 Aug 2013
Thank you - I'm confused because I thought flux was just grad(u) and am not sure where the c comes in. My equation has c = x, not a constant. Can I just use q = 0.1 and g = 0?
Bill Greene
Bill Greene on 5 Aug 2013
The "standard" definition of a flux boundary condition in a diffusion problem is: n*c*grad(u). But, if you want to apply a BC that is simply grad(u), that is perfectly fine. But, as you suspected, you would need to divide by the value of c on that boundary. If you include the variable 'x' in the expression for your BC, PDE Toolbox will automatically substitute the appropriate value for x on the boundary.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!