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.

Concentration does not reach zero

Please login with a confirmed email address before reporting spam

Hello!

I'm trying to model a catalytic reaction which is very exothermic and therefore the kinetics are quite fast. I want to simulate steady state, but until now I didn't have much sucess. The usual error ist 6192 "Power of negative". It happens when the concentration of one component reaches zero. With different tricks (refine mesh, including an expression for chemical equilibrium, rewriting the rate expression, logical operators (c>0)) I can get close to zero (ca. 4e-6). The value of the rate equation is zero when the concentration reache zero. But I don't get zero :(

Has anyone experienced this and knows what I can do else?

Best Regards

7 Replies Last Post 14 set 2010, 03:19 CEST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 gen 2010, 11:02 CET
Hi

my first check, for such an error, is the definition of your variable, or to turn on complex numbers for which the i.e. sqrt(-1) has a meaning. But perhap you can also define your criteria "0" as abs(??)<eps or a abs(??)<10*eps and the solution would probably be as good.

Where ?? being your optimisation/driving variable and "eps" is the internal representation of the "next to zero" magnitude possible in your floating point representation.

In fact its all about "what is "0" often <1% or <10 ppm of your initial values are sufficient to represent "0" and this can still be orders of magnitude away from a true "0.00"

It's all about how much time you want to wait for the solution ...

Good luck
Ivar
Hi my first check, for such an error, is the definition of your variable, or to turn on complex numbers for which the i.e. sqrt(-1) has a meaning. But perhap you can also define your criteria "0" as abs(??)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 25 gen 2010, 09:32 CET
Thank you Ivar!

The tip with setting an 'eps' sound very interesting. :)
I will try this next!!!

Till
Thank you Ivar! The tip with setting an 'eps' sound very interesting. :) I will try this next!!! Till

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 gen 2010, 10:41 CET
Hello!

I applied the logical expression according to Ivar's recomendation. It helped, but at last the concentration doesn't reach zero. Comsol includes a lot of frustration... :(

Till
Hello! I applied the logical expression according to Ivar's recomendation. It helped, but at last the concentration doesn't reach zero. Comsol includes a lot of frustration... :( Till

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 gen 2010, 11:22 CET
Hi

Well what is "zero", if you compare your 4E-6 to the initial value, could it not just be that regarding the model and the meshing <4e-6 is equivalent to "zero".
Clear if you started from 1E-6 its bigger but if you started at 1 you have already 6 orders of magnitude !

Furthermore, how do you set your convergence limits for the solver, if it considers 1E-6 as "small" then it will stop around E-6.

Mostly our frustration comes from uncomplete understanding of the complexity of our models, and often we would like to be more "perfect" than what our models truely are

Good luck
Ivar
Hi Well what is "zero", if you compare your 4E-6 to the initial value, could it not just be that regarding the model and the meshing

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 gen 2010, 16:08 CET
Hi,

I've used a neat trick before which I think was from the knowledge database (maybe it was in the model library). Instead of modelling your concentration C, make the dependent variable lnC, which is defined to be ln(C). You'll have to convert your differential equations to the new variable, using the relation C = exp(lnC), but it's straightforward due to the exponential function. The benefit is that C calculated in this way can never be negative, or even equal to zero! Also, you can model a range of orders of magnitudes very easily. You could then use the the threshold argument previously mentioned to say when the concentration was 'low enough' to be essentially zero, although if your reaction rate is proportional to your concentration then I don't think you would ever really hit zero anyway...

Hope this helps!
Mike
Hi, I've used a neat trick before which I think was from the knowledge database (maybe it was in the model library). Instead of modelling your concentration C, make the dependent variable lnC, which is defined to be ln(C). You'll have to convert your differential equations to the new variable, using the relation C = exp(lnC), but it's straightforward due to the exponential function. The benefit is that C calculated in this way can never be negative, or even equal to zero! Also, you can model a range of orders of magnitudes very easily. You could then use the the threshold argument previously mentioned to say when the concentration was 'low enough' to be essentially zero, although if your reaction rate is proportional to your concentration then I don't think you would ever really hit zero anyway... Hope this helps! Mike

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2 feb 2010, 09:43 CET
Thanks for the tip!

I'll try and write here about the results!

With regards
Till
Thanks for the tip! I'll try and write here about the results! With regards Till

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 set 2010, 03:19 CEST
can you post your comsol file..i will have a look..i had lot of problems when i was performing simulation of very complicated reactor...
can you post your comsol file..i will have a look..i had lot of problems when i was performing simulation of very complicated reactor...

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.