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 following concentration gradient in mass transport physics

Please login with a confirmed email address before reporting spam

Hello, I am setting up my model using transport of diluted species. I am simulating in a way that after certain time (24hr) my boundary concentration changes from 100 nM to zero. I used a step function to set this condition. My geometry is a circle and a concentration is supposed to come from outside boundary to the center. After 24hrs, when concentration changes to 0, there is more concentration in the center compared to the edge. Considering Fick's law of diffusion, the concentration is supposed to move following its gradient. However, in my case, the concentration just keeps going towards the center regardless of the concentration gradient. I was wondering if there is a way to control that in the transport of diluted species physics to make the transport just follow concentration gradient instead of being a unidirectional movement. Any help will be higly appreciated.

Thank you


4 Replies Last Post 2019年2月4日 GMT-5 03:50

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年2月1日 GMT-5 08:21

Did you call your step function correctly, i.e. (for example) c0*step1((t-ts)[1/s])? I have preferred the Heviside function like this:

c0*(1-flc2hs((t-ts)[1/s],0.001))

and I have defined in the parameters list c0 = 0.1[uM] and ts = 24[h].

I got a correct behaviour, except that the both ways are not completely sharp at t = 24h because, due to numerical reasons, the step is somewhat smoothed in the vicinity of the step point.

Another issue is that you must define the function below Component, not under Global definitions.

Did you call your step function correctly, i.e. (for example) c0*step1((t-ts)[1/s])? I have preferred the Heviside function like this: c0*(1-flc2hs((t-ts)[1/s],0.001)) and I have defined in the parameters list c0 = 0.1[uM] and ts = 24[h]. I got a correct behaviour, except that the both ways are not completely sharp at t = 24h because, due to numerical reasons, the step is somewhat smoothed in the vicinity of the step point. Another issue is that you must define the function below Component, not under Global definitions.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年2月1日 GMT-5 08:53
Updated: 5 years ago 2019年2月1日 GMT-5 10:30

A quick comment to say that a little smoothing at the step is recommended indeed. "Perfect" Heaviside steps, such as you'd get from using a boolean expression, can be missed by a transient solver that looks at gradients for signs that it should take smaller time steps. You'll want to use an amount of smoothing that is consistent with the real world transients (Perfect steps are unphysical - in your case a concentration cannot instantaneously change from one value to another). I think I remember there having been discussions about this in this Discussion Forum before, so you may want to do a search on that.

Jeff

-------------------
Jeff Hiller
A quick comment to say that a little smoothing at the step is recommended indeed. "Perfect" Heaviside steps, such as you'd get from using a boolean expression, can be missed by a transient solver that looks at gradients for signs that it should take smaller time steps. You'll want to use an amount of smoothing that is consistent with the real world transients (Perfect steps are unphysical - in your case a concentration cannot instantaneously change from one value to another). I think I remember there having been discussions about this in this Discussion Forum before, so you may want to do a search on that. Jeff

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年2月2日 GMT-5 21:41

Thank you so much for the replies Lasse and Jeff. The Heaviside function improved over the step function, Thank you for the suggestion. I think I was expecting too much: I was expecting a fast and obvious distribution due to backward diffusion as I saw with the forward diffusion (at early time points). Wasn't remembering that the gradient is much smaller after 24 hours since full distribution (same drug conc in all regions) is reached at this moment. Is there particular reason, to put the function under component instead of global definitions?

Thank you so much for the replies Lasse and Jeff. The Heaviside function improved over the step function, Thank you for the suggestion. I think I was expecting too much: I was expecting a fast and obvious distribution due to backward diffusion as I saw with the forward diffusion (at early time points). Wasn't remembering that the gradient is much smaller after 24 hours since full distribution (same drug conc in all regions) is reached at this moment. Is there particular reason, to put the function under component instead of global definitions?

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年2月4日 GMT-5 03:50

Once I noticed that my model did not recognize the function I defined under Global definitions. I do not know why.

Once I noticed that my model did not recognize the function I defined under Global definitions. I do not know why.

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.