pdetool concentration profile simulation

I want to use pdetool to simulate the hydrogen concentration profile based on the fick's second law in two dimensional system. the model is like this, there is two joined region A and B. diffusion coefficient in A is faster than that in B. hydrogen diffusion in this two region is 2 dimension(along x and y). they have the same boundary condition, for example the initial concentration is constant and same in A and B. how do we set the different diffusion coefficient in this two region? how should I do with the border between A and B region, since hydrogen will diffuse from A to B (y direction) since it is faster in A region. To me, it seems that after I set the boundary condition, I can not set different D in this two region.

 采纳的回答

You can set different D in the PDE app by selecting PDE > PDE Mode and then double-clicking each region to set its coefficients. I assume that you already set the problem type to Diffusion.
Alan Weiss
MATLAB mathematical toolbox documentation

1 个评论

Hi, thanks very much. 1,The version that I am using is R2014b. you mean that I choose PDE Mode in PDE menu after I draw two jointed rectangle region A and B for the diffusion problem type? I actually did this, I set different diffusio coefficients in region A and B, but the diffusion coefficients become the same again when I start to set the boundary condition. 2,If I first set the boundary condition, then I found that I can not set different diffusion coefficients in A and B(I can not choose the the individual region). 3, I am also wondering what should I do with the border of region A and B? My condition is that there is also diffusion from A to B along y dirrection since its fast diffusion in A region.
Thanks very much again and looking forward to new answers

请先登录,再进行评论。

更多回答(2 个)

Wen huang
Wen huang 2016-3-21
Hi, thanks very much. 1,The version that I am using is R2014b. you mean that I choose PDE Mode in PDE menu after I draw two jointed rectangle region A and B for the diffusion problem type? I actually did this, I set different diffusio coefficients in region A and B, but the diffusion coefficients become the same again when I start to set the boundary condition. 2,If I first set the boundary condition, then I found that I can not set different diffusion coefficients in A and B(I can not choose the the individual region). 3, I am also wondering what should I do with the border of region A and B? My condition is that there is also diffusion from A to B along y dirrection since its fast diffusion in A region.
Thanks very much again and looking forward to new answers

2 个评论

I cannot reproduce your problem exactly, though on occasion I, too, have seen that the boundary conditions or coefficients sometimes seem to change in an unpredictable fashion. This can occur when you change the problem type in the middle of setting up your problem.
I suggest that you draw the geometry first, immediately set the problem type (diffusion), then set the boundary conditions, and then the diffusion coefficients. I believe that you will not have any problems if you set things in this order.
Furthermore, I suggest that you read No Boundary Conditions Between Subdomains.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Thanks very much, but I still can not figure it out after I play with the steps you told me there, I must have made some mistakes. but I do not know where it is. I just list what my step is,and hopefully you can see where my mistake is.
Firstly, I draw 2 rectangle region, one of the sides for each region overlaps with each other, as shown in the first image. I also already set type of problem(diffusion). </matlabcentral/answers/uploaded_files/48468/1.png>
Secondly, I set the boundary condition(I choose the boundary mode, then specify the details), you can see this in the second image
Thirdly, I define the diffusion coefficients, I found that I can not choose the regions separately, so I directly go to PDF menu and can set D(i only can set one D), but I can not set different diffusion coefficients for this two regions separately. I am curious how you realize this. As I said before, if I define different D after I draw the first image immediately, the D will become same after I define boundary condition and mesh.
Thanks very much, and I hope you can see where my problem is this time, and give me a very detailed step to solve my problem. I never use pdetool before.

请先登录,再进行评论。

Wen huang
Wen huang 2016-3-25
this is the first image.

2 个评论

Hi Alan,
Can I get some answers from you?
Best
Wen
As I said, I cannot reproduce your problem. When I follow the exact steps I told you, then I can set the coefficients differently in the two domains. I am sorry not to be able to help you more.
You could try Technical Support and see if they can help.
Alan Weiss
MATLAB mathematical toolbox documentation

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by