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.

Attempt to evaluate negative power of zero error

Please login with a confirmed email address before reporting spam

I am working on a COMSOL model of 2D axisymmetric packed bed for studying breakthrough profiles of gases. I have defined all my Overall balance, component balance, Ergun's equation and LDF model equation using Mathematical General form PDE model. I am facing the following error when I used the valve equation (w0) as a Constraint (w - w0) at the outlet of my bed, where w is the velocity in z direction. {Note:My model converged and gave the output when my constraint term was just w, meaning outlet of the bed is closed}

Feature: Time-Dependent Solver 1 (sol2/t1) Attempt to evaluate negative power of zero. - Function: ^ Failed to evaluate temporary symbolic derivative variable. - Variable: comp1.b@VDN$comp1.p - Defined as: comp1.y((comp1.p2)(0.5(((comp1.p^2)-(P0^2))^(-0.5)))) Failed to evaluate temporary symbolic derivative variable. - Variable: comp1.w0@VDN$comp1.p - Defined as: ((((TPstd)comp1.x)(comp1.y((comp1.p2)(0.5(((comp1.p^2)-(P0^2))^(-0.5))))))(1/(((comp1.peb0)A)Tstd)))+((Tstd(eb0A))((-(((TPstd)comp1.x)comp1.b))/((((comp1.peb0)A)Tstd)^2))) Failed to evaluate expression. - Expression: d(comp1.w-comp1.w0,comp1.p) Failed to evaluate Jacobian of expression. - Expression: comp1.w-comp1.w0

Questions:

1) How to define Modulus of a term and will that help to solve this problem? 2) What are the ways to solve this error, is there some kind of time stepping or meshing corrections to be made? Please suggest. Thanks



3 Replies Last Post Jun 12, 2019, 5:40 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 5 years ago Jun 6, 2019, 12:47 p.m. EDT
Updated: 5 years ago Jun 6, 2019, 12:47 p.m. EDT

From your expression you are computing

And apparently the numerator of this expression was identically 0 during your simulation. So the solution depends on these questions:

  • Is the above expression correct?
  • Is it physically possible for p and P0 to be equal in your case (or equal and opposite) ?
  • if you answered yes to both of the questions above, what do you expect will happen physically when p= ± P0 ?
From your expression you are computing \frac{1}{\sqrt{p^2 - P0^2}} And apparently the numerator of this expression was identically 0 during your simulation. So the solution depends on these questions: * Is the above expression correct? * Is it physically possible for `p` and `P0` to be equal in your case (or equal and opposite) ? * if you answered yes to both of the questions above, what do you expect will happen physically when `p= ± P0` ?

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago Jun 7, 2019, 5:30 a.m. EDT

I do not know the exact source of the problem in this case, but it is not uncommon that there is nothing suspicious in original expression, and that the problematic expression occurs only after internal symbolic differentiation. As soon as an expression contains a variable raised to a power <1, there is a risk of getting singular derivatives at zero.

In such cases, it often helps to add a small number (like the built-in variable ‘eps’) to the expression, so that the problematic denominator is never exactly zero.

Here is an example where the definition of a built-in variable within the field of soil plasticity is safeguarded in this way, since the square root is ‘dangerous’:

sqrt(solid.II2s+eps)+solid.lemm1.soil1.alpha*solid.I1s-solid.lemm1.soil1.k

Regards,
Henrik

-------------------
Henrik Sönnerlind
COMSOL
I do not know the exact source of the problem in this case, but it is not uncommon that there is nothing suspicious in original expression, and that the problematic expression occurs only after internal symbolic differentiation. As soon as an expression contains a variable raised to a power

Please login with a confirmed email address before reporting spam

Posted: 5 years ago Jun 12, 2019, 5:40 p.m. EDT
Updated: 5 years ago Jun 12, 2019, 5:41 p.m. EDT

Thank you Mr. Alexis and Mr. Henrik for taking time to provide your valuable suggestions for the problem. When i used the abs operator for the modulus and added the in built variable 'eps' to the expression, I was thankfully able to get over the failed to evaluate negative power of zero error. Then I faced the error message
Feature: Time-Dependent Solver 1 (sol2/t1) Failed to find consistent initial values. Last time step is not converged.

I have improved my meshing by using boundary layer meshes and made it lot more finer with more nodes. Does this error mean a problem with the boundary condition/initial condition or it could also have other factors solver configuration affecting it? Kindly suggest.

Thanks in advance for your help.

Thank you Mr. Alexis and Mr. Henrik for taking time to provide your valuable suggestions for the problem. When i used the abs operator for the modulus and added the in built variable 'eps' to the expression, I was thankfully able to get over the failed to evaluate negative power of zero error. Then I faced the error message Feature: Time-Dependent Solver 1 (sol2/t1) Failed to find consistent initial values. Last time step is not converged. I have improved my meshing by using boundary layer meshes and made it lot more finer with more nodes. Does this error mean a problem with the boundary condition/initial condition or it could also have other factors solver configuration affecting it? Kindly suggest. Thanks in advance for your help.

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.