Multi-region Finite Difference- Interface between materials

timman_24
Messages
52
Reaction score
0
I am writing a multi-region diffusion code. The two regions have different material properties, so the analytical solution shows a discontinuity at the interface between the regions.

As can be seen here:

attachment.php?attachmentid=35045&stc=1&d=1304197454.png


The numerical code I am running is (Mathematica):

Code:
While[converge > .00001,
 count = count + 1;
 list1[[1]] = list1[[2]];
 For[i = 2, i < Ai + 1, i++,
  list1[[i]] = Dw (list1[[i - 1]] + list1[[i + 1]])/(H^2 Ea1 + 2 Dw)];
 For[j = Ai + 1, j < (Ai + Bi), j++,
  list1[[j]] = .5*(-H^2 (list1[[j]] Ea2/Dc - S/Dc) + list1[[j - 1]] + 
      list1[[j + 1]])];
 converge = Max[Abs[list2 - list1]];
 list2 = list1;]

This works great if the material properties between the two regions are identical, but if I use differing material properties, I still get a smooth curve:

attachment.php?attachmentid=35046&stc=1&d=1304197454.png


Is there a trick to getting this to work with finite difference method? How do I deal with this type of interface condition?

Thanks guys
 

Attachments

  • Analyticalpart1.png
    Analyticalpart1.png
    2.3 KB · Views: 539
  • Analyticalpart1num.png
    Analyticalpart1num.png
    2.3 KB · Views: 605
Physics news on Phys.org
Colud you please post the problem you're trying to solve? I'm not sure, but it looks like you're missing some sort of jump condition. You should check if your algorithm is correct when j = Ai, because that's where the coupling occurs.
 
I ended up adding an interface condition to the solver.

To conserve current, we need this condition to be satisfied at the boundary:

D_{1}J_{1}(x)=D_{2}J_{2}(x)

To satisfy this condition, I stopped at the interface and applied this condition at that point. Then I continued. I used a backward difference scheme for the J_{1} and a forward difference approx for the J_{2} and rearranged for i.

This gave me the kink I was looking for.

BTW, this was a neutron diffusion model in a slab with two materials.
 
There is the following linear Volterra equation of the second kind $$ y(x)+\int_{0}^{x} K(x-s) y(s)\,{\rm d}s = 1 $$ with kernel $$ K(x-s) = 1 - 4 \sum_{n=1}^{\infty} \dfrac{1}{\lambda_n^2} e^{-\beta \lambda_n^2 (x-s)} $$ where $y(0)=1$, $\beta>0$ and $\lambda_n$ is the $n$-th positive root of the equation $J_0(x)=0$ (here $n$ is a natural number that numbers these positive roots in the order of increasing their values), $J_0(x)$ is the Bessel function of the first kind of zero order. I...
Are there any good visualization tutorials, written or video, that show graphically how separation of variables works? I particularly have the time-independent Schrodinger Equation in mind. There are hundreds of demonstrations out there which essentially distill to copies of one another. However I am trying to visualize in my mind how this process looks graphically - for example plotting t on one axis and x on the other for f(x,t). I have seen other good visual representations of...
Back
Top