Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Diffusion

Please login with a confirmed email address before reporting spam

Hi. How do I stop difusion when a certain concentration is reached in COMSOL?

I have a 2D rectangular section with an initial concentration of say 40mol/m^3 (wet solid) and concentration at the outer edges at 10mol/m^3.

How do I stop the diffusion when the concentration gets to 10mol/m^3?

Thank you.


4 Replies Last Post 10.12.2017, 23:28 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 07.12.2017, 10:39 GMT-5

Hi,

I do not understand your question fully.

One way is to limit diffusion coefficient to a very low value when you reach the target concentration.

i.e. go to the cell where you enter diffusion coefficient, D=if(c<10,1e-16,Dorig). Where Dorig is the original diffusion coefficient when concentration is above 10. 1e-16 is a small diffusion coefficient (of course depends on which process and scale).

But you have to be careful because smaller D will make the problem highly unstable. You can try between 1e-14 to 1e-16, whichever works. If you have convergence issues, try to use heaviside function to smooth the jump.

Suresh

Hi, I do not understand your question fully. One way is to limit diffusion coefficient to a very low value when you reach the target concentration. i.e. go to the cell where you enter diffusion coefficient, D=if(c

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 08.12.2017, 01:36 GMT-5

Hi Suresh. Thanks a lot for your reply.

Actually the solution does not converge even when I use 1e-8.

All I want is to stop the diffusion from taking place when a certain concentration is reached.

Thank you.

Hi Suresh. Thanks a lot for your reply. Actually the solution does not converge even when I use 1e-8. All I want is to stop the diffusion from taking place when a certain concentration is reached. Thank you.

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 09.12.2017, 13:59 GMT-5

Dear Anna,

You can use Events in Mathematics -> ODE and DAE Interfaces -> Events and add an Implicit Event, then you only need to enter the condition and reinitialization of diffusion coefficient after the critical density reached.

Dear Anna, You can use Events in Mathematics -> ODE and DAE Interfaces -> Events and add an Implicit Event, then you only need to enter the condition and reinitialization of diffusion coefficient after the critical density reached.

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 10.12.2017, 23:28 GMT-5

Thank you Vasily.

I found an example here: https://www.comsol.com/blogs/implementing-a-thermostat-with-the-events-interface/

I just have to learn how to use it now.

Thank you Vasily. I found an example here: https://www.comsol.com/blogs/implementing-a-thermostat-with-the-events-interface/ I just have to learn how to use it now.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.