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.

Error: "Attempt to evaluate negative power of zero."

Please login with a confirmed email address before reporting spam

I'm building a model using the Reaching Flow in Porous Media in a 2D axis-symmetric component, and my goal is to remove some of the dilute species from the system as a function of concentration and fluid velocity (e.g. the reaction slows as concentration decreases, and is increased when fluid velocity is high).

I can get the model to behave as expected, but I cannot successfully implement a velocity dependent Reaction. I am able to use a constant (e.g. -0.01 [mol/m^3/s]) or concentration dependent reaction rate, but if I try to use average velocity I get the error:

Attempt to evaluate negative power of zero.
- Function: ^
Failed to evaluate temporary symbolic derivative variable.
- Variable: comp1.rfds.U@VDN$comp1.w2
- Defined as: (0.5*(((comp1.u2^2)+(comp1.w2^2))^(-0.5)))*(2*comp1.w2)
Failed to evaluate expression.
- Expression: d(comp1.rfds.U,comp1.w2)

I attempted to incorporate the velocity in the porous domain (or any domain.. just trying to get anything to work for starters) by setting up an Average of the porous domain (Component --> Definitions --> Average), then defining a variable as the velocity magnitude of that domain (comp1.aveop1(rfds.U)).

I have consulted other threads here and saw recommendations to use 'eps' when defining my variable to prevent my initial expression from being zero, but this doesn't seem to help. Any guidance is appreciated, and I can provide further details of the model as necessary.



3 Replies Last Post 22.05.2017, 15:54 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 15.03.2016, 11:58 GMT-4
I think your problem is at comp1.w2.
Make sure you use "eps" for comp1.w2 in any expression in your model as (comp1.w2+eps).
Hope what I think can help you.
Good luck.
I think your problem is at comp1.w2. Make sure you use "eps" for comp1.w2 in any expression in your model as (comp1.w2+eps). Hope what I think can help you. Good luck.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 15.03.2016, 12:21 GMT-4

I think your problem is at comp1.w2.
Make sure you use "eps" for comp1.w2 in any expression in your model as (comp1.w2+eps).
Hope what I think can help you.
Good luck.


Thank you for the advice! Unfortunately my input expression is for the magnitude of the velocity (comp1.aveop1(rfds.U)), and the comp1.w2 expression is automatically pulled out of rfds.U, so I don't know of a way to manipulate w2 specifically with eps. I have tried using eps with rfds.U: (comp1.aveop1(rfds.U+eps)) but this encounters the same error.
[QUOTE] I think your problem is at comp1.w2. Make sure you use "eps" for comp1.w2 in any expression in your model as (comp1.w2+eps). Hope what I think can help you. Good luck. [/QUOTE] Thank you for the advice! Unfortunately my input expression is for the magnitude of the velocity (comp1.aveop1(rfds.U)), and the comp1.w2 expression is automatically pulled out of rfds.U, so I don't know of a way to manipulate w2 specifically with eps. I have tried using eps with rfds.U: (comp1.aveop1(rfds.U+eps)) but this encounters the same error.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 22.05.2017, 15:54 GMT-4
Hi..Could you solve for the velocity expression.. I am facing similar problem.. The error is same at that of yours.. My case requires the marangoni velocity from the upper domain to be used as an input to porous lower domain.. Can you please help me figure a way out ?
Hi..Could you solve for the velocity expression.. I am facing similar problem.. The error is same at that of yours.. My case requires the marangoni velocity from the upper domain to be used as an input to porous lower domain.. Can you please help me figure a way out ?

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.