Message Boards Message Boards

Static solutions to diffusion equation in 2D

Posted 8 years ago

Hello,

Can you please help with the following?

I am looking for solutions of a static diffusion equation in 2D plane outside of a disk of some radius

D[u[x, y], x, x] + D[u[x, y], y, y]=0,

under the following Neumann boundary conditions (i.e. specification of normal derivative) on a disk

 -\[Alpha] Cos[\[Theta]]^p.

Here, I have assumed that the origin of the coordinate system and disk center coincide, 'Theta' is the polar angle, and 'alpha' and 'p' are some parameters. Of special interest are the values p=1,2 and alpha=-1,1. Also, let us assume Dirichlet boundary conditions hold sufficiently far from the disk.

Here is my code (also attached to this message) for 'Alpha=-1' and 'p=1' designed to solve in a square of size 100 and outside a disk of radius 10

xmax = 100; ymax = 100;
\[CapitalOmega] = 
  RegionDifference[Rectangle[{0, 0}, {100, 100}], Disk[{50, 50}, 10]];
RegionPlot[\[CapitalOmega], AspectRatio -> Automatic];
\[CapitalOmega] = 
  RegionDifference[Rectangle[{0, 0}, {xmax, ymax}], 
   Disk[{xmax/2, ymax/2}, 10]];
\[CapitalOmega]plot = 
  RegionDifference[
   Rectangle[{xmax/4, ymax/4}, {(3 xmax)/4, (3 ymax)/4}], 
   Disk[{xmax/2, ymax/2}, 10]];
Clear[u];
Subscript[\[CapitalGamma], N] = 
  NeumannValue[-((x - xmax/2)/
     Sqrt[(x - xmax/2)^2 + (y - ymax/2)^2]), (x - xmax/2)^2 + (y - 
       ymax/2)^2 == 10^2];
Subscript[\[CapitalGamma], D] = 
  DirichletCondition[
   x == 0 && 0 <= y <= ymax || x == xmax && 0 <= y <= ymax || 
    0 <= x <= xmax && y == 0 || 0 <= x <= xmax && y == ymax, 
   u[x, 0] == u[x, ymax] == u[0, y] == u[xmax, y] == 10];
sol = NDSolve[{D[u[x, y], x, x] + D[u[x, y], y, y] == 
    Subscript[\[CapitalGamma], N], Subscript[\[CapitalGamma], D]}, 
  u, {x, y} \[Element] \[CapitalOmega]]
Plot3D[u[x, y] /. sol, {x, y} \[Element] \[CapitalOmega]plot, 
 PlotRange -> All]

Here is the problem description and my two questions:

  1. The code didn't implement Dirichlet boundary conditions, which is clearly seen in the plot. The following messages appeared.

(i) "The boundary condition \ {DirichletCondition[(x==0&&0<=y<=100)||(x==100&&0<=y<=100)||(0<=x<=\ 100&&y==0)||(0<=x<=100&&y==100),u==u==u==u==10]} cannot be parsed and \ will be ignored."

(ii) No DirichletCondition or Robin-type NeumannValue was specified \ for {u}; the result is not unique up to a constant.

In what way should I modify the code to implement the Dirichlet boundary conditions?

  1. Up to a constant shift, the solution for 'p=1' is meaningful. How can I modify the code so it converges also for 'p=2' ?

Thank you, Shimon

Attachments:
POSTED BY: Shimon Rubin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract