Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Mathematics creating an "impossible" physics while solving

Please login with a confirmed email address before reporting spam

Hi !

I have a steady state model where a irreversible reaction occurs, simple a+b = c. Theres a flux of "a" coming from one of my boundarys, the one at the bottom on the attached picture and this reacts with b (bulk material) to produce c.

Because of what I think must be the mathematics I get a band of negative values of a, something that not will happen in "real life". See attached picture.

Have read a bit around but without luck. Is there any way to control the reaction in such a way that

if a >= 0 then the actual concentration is used in the reaction equation
if a< 0 the concentration is set to zero, giving a reaction result of zero

Thanks for your help and tips.

Nils Eivind


3 Replies Last Post 12 sept. 2011, 12:34 UTC−4
Lechoslaw Krolikowski

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 sept. 2011, 11:37 UTC−4
Hi,
You can define reaction rate as r=k*a*b*(a>0) but the problem probably lies in the occurrence of spurious oscillations of the concentration of "a". This kind of the numerical error appears when an element Peclet number is larger than one.
Best Regards,
Andrzej
Hi, You can define reaction rate as r=k*a*b*(a>0) but the problem probably lies in the occurrence of spurious oscillations of the concentration of "a". This kind of the numerical error appears when an element Peclet number is larger than one. Best Regards, Andrzej

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12 sept. 2011, 04:21 UTC−4

Hi,
You can define reaction rate as r=k*a*b*(a>0) but the problem probably lies in the occurrence of spurious oscillations of the concentration of "a". This kind of the numerical error appears when an element Peclet number is larger than one.
Best Regards,
Andrzej


Thanks Lechoslaw.

Have tested a bit during the weekend and the suggested addition *(a>0) doesnt seem to fix it.

To clearify a bit, in my reaction scheme I set the reaction forming c, rc= k*a'b and at the same time i set the consumption of a equal to ra=-k*a*b. I need this expression telling the model to consume a otherwise the model overestimates the amount of c formed.

Any other tricks that could solve the spurious oscillations in a steady state model ?
Have also tried to coursen the mesh to increase dx^2 but that didnt do the trick either.

Thanks alot for your time
Nils Eivind
[QUOTE] Hi, You can define reaction rate as r=k*a*b*(a>0) but the problem probably lies in the occurrence of spurious oscillations of the concentration of "a". This kind of the numerical error appears when an element Peclet number is larger than one. Best Regards, Andrzej [/QUOTE] Thanks Lechoslaw. Have tested a bit during the weekend and the suggested addition *(a>0) doesnt seem to fix it. To clearify a bit, in my reaction scheme I set the reaction forming c, rc= k*a'b and at the same time i set the consumption of a equal to ra=-k*a*b. I need this expression telling the model to consume a otherwise the model overestimates the amount of c formed. Any other tricks that could solve the spurious oscillations in a steady state model ? Have also tried to coursen the mesh to increase dx^2 but that didnt do the trick either. Thanks alot for your time Nils Eivind

Lechoslaw Krolikowski

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12 sept. 2011, 12:34 UTC−4
Hi Nils!

I don’t know whether your reaction-diffusion model is the model with fluid flow or without (diffusion across quiescent fluid).
If without then Peclet number is equal to zero but false oscillations can occur when the grid is too coarse.
The oscillations are also caused by large walues of k. The larger k the denser mesh you have to apply especially in the strong gradient zone.

Regards,
Andrzej
Hi Nils! I don’t know whether your reaction-diffusion model is the model with fluid flow or without (diffusion across quiescent fluid). If without then Peclet number is equal to zero but false oscillations can occur when the grid is too coarse. The oscillations are also caused by large walues of k. The larger k the denser mesh you have to apply especially in the strong gradient zone. Regards, Andrzej

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.