Discussion Forum

how to avoid negative concentration

Topics: no topics

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   12 Replies   Last post: June 25, 2010 8:15pm UTC
Xin Jin

Xin Jin

March 17, 2010 3:35pm UTC

how to avoid negative concentration

Hi,

I have a dynamic diffusion problem. I do not know why after running some time, I can get some negative values...I have checked the boundary conditions and they are correct...The concentration can not go for minus values...but actually I got negative values and I could not explain why...

Is there someone could hlep me to solve this problem or give me some suggestions?

Thanks in advance.

Xin

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Xin Jin

Xin Jin

March 17, 2010 5:12pm UTC in response to Xin Jin

Re: how to avoid negative concentration

Is there anyone could help me? This problem is really strange...

I have checked...at some point I already got a zero flux at boundary which means the concentration will remain the same but it was not...The concentration still decrease...I am confused by this results because the boundary flux was already zero how can I get decreased concentration even minus concentration?

I read from the Knowledge Base that we could use smooth step function to avoid this but I did not really get how to do it...

I will appreciate if some could help me to work this out.

Thanks!

Xin

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Arsen Subashiev

Arsen Subashiev

March 17, 2010 9:49pm UTC in response to Xin Jin

Re: how to avoid negative concentration

I had the same problem. Seems that it results from too rude mesh.
Using "Refine Mesh" command always helped me,
though at first I have not expected that I need such a refined mesh to eliminate
large variations of concentration and its negative values.

Good luck,
Arsen

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Xin Jin

Xin Jin

March 18, 2010 9:06am UTC in response to Arsen Subashiev

Re: how to avoid negative concentration

Hi Arsen,

Thanks for your suggestions. But it was not suitable for my problem...do you have any other suggestions? Thanks a lot.

Xin

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Danial Tz

Danial Tz

March 18, 2010 5:35pm UTC in response to Xin Jin

Re: how to avoid negative concentration

It is possible that you have instability problems, which are common with high convection PDEs.

Try using "artificial diffusion". This way you will not get overshoots and undershoots around c=0. Also try refining the mesh where the element has high C.

There is a KnowledgeBase dedicated to this kind of problems. please search negative concentration.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Xin Jin

Xin Jin

March 19, 2010 4:12pm UTC in response to Xin Jin

Re: how to avoid negative concentration

Thanks for everyone's help. The problem is finally solved by using smoothing step function as introduced in the knowledge base.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Blaise Mulliez

Blaise Mulliez

March 23, 2010 4:20pm UTC in response to Xin Jin

Re: how to avoid negative concentration

Hello.

I have a similar problem. Could you explain me how to use the smoothing function introduced in the KnowledgeBase?

Thanks a lot.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Xin Jin

Xin Jin

March 24, 2010 10:30am UTC in response to Blaise Mulliez

Re: how to avoid negative concentration

for my case, because I have a negative concentration which I guess it is because of the boundary conditions.

the boundary condition is:

N = kc*(Csurface-Cair)

with smoothing function

N = flc2hs(Cair-Csurface,dC)*kc*(Csurface-Cair)

where the variable dC is a constant that defines the smoothing interval width. Define this variable on the Options>Constants menu. It will take some experimenting to find a good value; start with a large value (large enough so that negative values do not occur), then decrease it as far as possible while keeping the solution positive.

I hope it helps.

Good luck,

Xin

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Blaise Mulliez

Blaise Mulliez

March 25, 2010 10:45am UTC in response to Xin Jin

Re: how to avoid negative concentration

Hi.

I am very new to Comsol, and I cannot find where to write this equation.

Is it in the NS model or in the CD one ? Can you more specific please ?

Thank you so much.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Xin Jin

Xin Jin

March 25, 2010 11:25am UTC in response to Blaise Mulliez

Re: how to avoid negative concentration

first, you need to make sure where you want to have this smooth function.

my example is just my case, for yours, you must think about where you want this? at boundary condition or some other expressions. then you can just put the smooth function in front of your equation.

flc2hs(a,dC)*your equation.

the equation can be at boundaries or at any global expression.

I hope it is clear now

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Davis Sentman

Davis Sentman

April 19, 2010 9:45am UTC in response to Xin Jin

Re: how to avoid negative concentration

If the dependent variable is something like mass or particle density that must always be a positive quantity, another solution is to rewrite the original DE in terms of the logarithm of the variable. This would then require using the equation form to set up the model, and the terms might be complicated, but at least you would automatically be guaranteed that the results would be positive, regardless of whatever instability that there might be because of a too-course meshing.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Franz Bozsak

Franz Bozsak

June 25, 2010 6:42pm UTC in response to Xin Jin

Re: how to avoid negative concentration


the boundary condition is:

N = kc*(Csurface-Cair)



Hi Xin,

I am currently setting up my very first coupled convection/diffusion and fluid flow testcase in COMSOL and thus I have an extremely basic question, but I just don't see how it is done. How do you specify this flux in a case where you have convection and diffusion? Or rather how do you address the variable "C on the boundary" and "C in the flow"? Thank you very much for your help.

Franz

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Franz Bozsak

Franz Bozsak

June 25, 2010 8:15pm UTC in response to Franz Bozsak

Re: how to avoid negative concentration

To rephrase my question from above (I have looked all over tutorials, model files and such and could not find this): What is the proper syntax to define a Flux Discontinuity at a fluid/solid (or solid/solid) interface in the form: N = k*(c_surface - c_flow) ?
Thank you for any help on this.

Franz

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines