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
Posted 2010年1月22日 GMT+8 22:58 7 Replies
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
I'll try and write here about the results!
With regards
Till
Please login with a confirmed email address before reporting spam
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.
Suggested Content
- KNOWLEDGE BASE Matrix Has Zero on Diagonal
- BLOG Modeling Electromigration in COMSOL Multiphysics®
- KNOWLEDGE BASE Avoiding Negative Concentrations
- FORUM Zero concentration
- KNOWLEDGE BASE Error: Singular Matrix
