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 real square root of negative number. - Function: sqrt Failed to evaluate variable. - Variable: comp1.mf

Please login with a confirmed email address before reporting spam

Hello Everyone,

I am doing a simulation on laser keyhole welding and I am getting the following error: Attempt to evaluate real square root of negative number. - Function: sqrt Failed to evaluate variable. - Variable: comp1.ṁ (errors related to this ṁ variable: please see the attached figure. I have encircled this variable with red pen) I am trying to remove this error like last month. This "ṁ" variable (mass flow rate) has only one parameter in the square root which is Temperature (T) and I even put a boundary condition as T>Tvap. Smoothed the material properties. Refined the mesh. But no luck in solving this error. I request to all elite members to comment on it. I would be grateful to you. Thank you.



2 Replies Last Post Apr 15, 2020, 6:35 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Apr 14, 2020, 2:36 p.m. EDT

Hello,

If you are absolutely certain that your square root argument is greater than zero, you can try adding "eps" to the square root argument. There is a possibility that if the argument is zero, it will be numerically taken as negative, so that adding a very small number could fix this issue. Let me know if this helps.

Cheers,

Alex

Hello, If you are absolutely certain that your square root argument is greater than zero, you can try adding "eps" to the square root argument. There is a possibility that if the argument is zero, it will be numerically taken as negative, so that adding a very small number could fix this issue. Let me know if this helps. Cheers, Alex

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Apr 15, 2020, 6:35 p.m. EDT

Thank you Alex for your input.

When I added eps inside the sqrt term, it made it run the simulation in the beggining but after a while, same error shown.

I think, my initial condition or BC has some problems. I am going to change some conditions and update you the results.

What are you working on ? I am modelling a laser keyhole weldings phenomenon.

Regards, Akash Meena

Thank you Alex for your input. When I added eps inside the sqrt term, it made it run the simulation in the beggining but after a while, same error shown. I think, my initial condition or BC has some problems. I am going to change some conditions and update you the results. What are you working on ? I am modelling a laser keyhole weldings phenomenon. Regards, Akash Meena

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.