setting generalised Neumann boundary conditions in pdetoolbox when c is not 1
Afficher commentaires plus anciens
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?
Réponses (1)
Bill Greene
le 5 Août 2013
Modifié(e) : Bill Greene
le 5 Août 2013
0 votes
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 commentaires
Sarah
le 5 Août 2013
Bill Greene
le 5 Août 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.
Catégories
En savoir plus sur Geometry and Mesh dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!