5
$\begingroup$

I want to solve the diffusion equation on a disk centered at (0,0) with a radius of 1. I also want the flux at a radius of 0.8 to be zero. I have this initial condition at time zero:

u[x, y, 0] == Exp[(-x^2 - y^2)/0.01] + 10*Exp[-(((x - 1)^2 + (y)^2)/0.01)]

The initial condition looks like this:

enter image description here

The solution after time 50 looks like this:

enter image description here

The problem is that I expected because the flux is zero at radius of 0.8 then at the distance more than 0.8 from the origin the value of variable u[x,y,t] should be different from that of at distances shorter than 0.8. However, everything looks equilibrated.

Here is the whole code:

sol = NDSolveValue[{
        Laplacian[u[x, y, t], {x, y}] == D[u[x, y, t], t] + 
          NeumannValue[0., {x, y} ∈ RegionDifference[Disk[{0, 0}, 1], Disk[{0, 0}, 0.8]]],
        u[x, y, 0] == Exp[(-x^2 - y^2)/0.01] + 10*Exp[-(((x - 1)^2 + y^2)/0.01)]},
       u, {x, y} ∈ Disk[{0, 0}, 1],
       {t, 0, 50}
      ]

Plot3D[sol[x, y, 0], {x, y} ∈ Disk[{0, 0}, 1], PlotRange -> All]

enter image description here

$\endgroup$

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • 3
    $\begingroup$ Here it is necessary to solve two problems: 1) on the disk x^2+y^2<=0.8^2, 2) on the ring 0.8^2<=x^2+y^2<=1. $\endgroup$ – Alex Trounev Mar 22 at 14:19
  • $\begingroup$ Thank you. In this link I reduced my real problem and asked a new question. I think I will delete this question then. mathematica.stackexchange.com/questions/193789/… $\endgroup$ – MOON Mar 22 at 20:36
  • $\begingroup$ Why delete? It's an interesting question! $\endgroup$ – mjw Mar 25 at 12:17
  • $\begingroup$ @mjw Yuo are right. At first I thought the other question I asked covers this one. But they seem unrelated. I will not delete the question. $\endgroup$ – MOON Mar 25 at 12:34
  • $\begingroup$ @MOON, Thanks. Hope to have time later to work on it. In any case, looking forward to seeing it develop. $\endgroup$ – mjw Mar 25 at 13:31
3
$\begingroup$

Here is a way to have an internal NeumannValue:

We generate a mesh with an internal boundary:

Needs["NDSolve`FEM`"]
mesh = ToElementMesh[Annulus[{0, 0}, {8/10, 1}], 
   "RegionHoles" -> None];
mesh["Wireframe"]

enter image description here

The mesh has boundary markers:

mesh["BoundaryElementMarkerUnion"]
{1, 2}

Visualize the mesh with it's boundary elements grouped by the markers:

mesh["Wireframe"["MeshElement" -> "BoundaryElements", 
  "MeshElementStyle" -> {Blue, Orange}]]

enter image description here

Solve the equation:

sol = NDSolveValue[{Laplacian[u[x, y, t], {x, y}] == 
     D[u[x, y, t], t] + NeumannValue[1, ElementMarker == 1], 
    u[x, y, 0] == 
     Exp[(-x^2 - y^2)/0.01] + 10*Exp[-(((x - 1)^2 + y^2)/0.01)]}, 
   u, {x, y} \[Element] mesh, {t, 0, 50}];

And visualize the result:

Plot3D[sol[x, y, 50], {x, y} \[Element] mesh, PlotRange -> All]

enter image description here

$\endgroup$
  • $\begingroup$ Why NeumannValue[1,... ? The way I understand the question ("flux at a radius of 0.8 to be zero") it should be NeumannValue[0,... $\endgroup$ – andre314 Apr 22 at 10:23
  • $\begingroup$ Though I don't find the question clear. In my interpretation, it could be reformulated as to 2 independent problems. $\endgroup$ – andre314 Apr 22 at 10:27
  • $\begingroup$ @andre314, because with `NeumannValue[0,...] you do not see anything. The numerical offset is too small. I also find the question not that clear, so I started with what I gathered and wanted to see what OP had to say. $\endgroup$ – user21 Apr 22 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.