Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Internal error in piecewise expression evaluation

Please login with a confirmed email address before reporting spam

Merry Christmas everybody,

I was simulating a laminar flow in a heated circular duct with a non-newtonian Fluid. In order to describe the dynamic viscosity I used the non-newtonian power law with the parameters m and n.
I do simulations with heating powers 500-1500W at mass flows 0.25, 0.5, 0.75 and 1 kg/min. For some reason the following simulations abort:
0,75 kg/min: 750W, 1500W
1 kg/min: 500W, 750W, 1000W, 1500W

The following error is shown:
“Internal error in piecewise expression evaluation.
- Expression: 0.027-0.0050*log(-273.15+T)”

Which is used in the flow consistency index m. As soon as I raise the parameter border to 273.16K (to prevent log(0) become infinity, but it worked fine earlier) I get the error:
“Failed to find a solution.
Singular matrix.

There are 84805 equations giving NaN/Inf in the matrix rows for the variable mod1.T.
at coordinates: (0.0039021,0.001), (0.00386713,0.001), (0.00382797,0.001), (0.00378462,0.001), (0.00373706,0.001), ...

There are 84266 degrees of freedom giving NaN/Inf in the matrix columns for the variable mod1.T.
at coordinates: (0.00382797,0.001), (0.00378462,0.001), (0.00373706,0.001), (0.00368531,0.001), (0.00362937,0.001), ...
There are 42940 degrees of freedom giving NaN/Inf in the matrix columns for the variable mod1.u.
at coordinates: (0.00368531,0.001), (0.00362937,0.001), (0.00382797,0.002), (0.00378462,0.002), (0.00373706,0.002), ...
There are 36019 degrees of freedom giving NaN/Inf in the matrix columns for the variable mod1.w.
at coordinates: (0.00398182,0.035), (0.00395944,0.035), (0.00393287,0.035), (0.00398182,0.036), (0.00395944,0.036), ...
Returned solution is not converged.”

Do you have any idea what the first error indicates for my equation. Everything worked fine in all the earlier simulations. I just changed the parameter for the heating power :(

Sincerely, Fabian Holz


3 Replies Last Post Dec 29, 2013, 6:16 p.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 27, 2013, 3:31 a.m. EST
I tried to describe the flow consistency index m by an analytic instead of a piecewise function. Now COMSOL states the following error. Maybe it helps to define the problem.. (boundary 3 is the Outlet of the duct)

"Error in user-defined function.
- Function: m
Failed to evaluate variable.
- Variable: mod1.nitf.m_pow
- Defined as: m((mod1.T/unit_K_cf))
Failed to evaluate variable.
- Variable: mod1.nitf.mu
- Defined as: (mod1.nitf.m_pow*(mod1.nitf.sr^((-1)+mod1.nitf.n_pow)))
Failed to evaluate expression.
- Expression: mod1.nitf.mu
Failed to evaluate operator.
- Operator: mean
- Geometry: 1
- Boundary: 3"
I tried to describe the flow consistency index m by an analytic instead of a piecewise function. Now COMSOL states the following error. Maybe it helps to define the problem.. (boundary 3 is the Outlet of the duct) "Error in user-defined function. - Function: m Failed to evaluate variable. - Variable: mod1.nitf.m_pow - Defined as: m((mod1.T/unit_K_cf)) Failed to evaluate variable. - Variable: mod1.nitf.mu - Defined as: (mod1.nitf.m_pow*(mod1.nitf.sr^((-1)+mod1.nitf.n_pow))) Failed to evaluate expression. - Expression: mod1.nitf.mu Failed to evaluate operator. - Operator: mean - Geometry: 1 - Boundary: 3"

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 28, 2013, 11:42 a.m. EST
Hi,

I tested your model and add few things. First I add "Outflow" for heat transfer. Second I add initial value for fluid flow (0.1 m/s). With these I got your model working.

Best regards

Tero Hietanen
Hi, I tested your model and add few things. First I add "Outflow" for heat transfer. Second I add initial value for fluid flow (0.1 m/s). With these I got your model working. Best regards Tero Hietanen

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 29, 2013, 6:16 p.m. EST
Hey Tero,

thank you that you investigated in my topic. Unfortunately I can't add an initial flow velocity, because the my massflow parameter is fixed. But your advice with "outflow" gave me a hint. I figured out that in the "outlet" condition I selected "laminar outflow to exit pressure" with a too short exit length (although the simulation always succeeded in the past). As soon as I put in a longer exit length, the model is working again. Even without the "outflow" boundary condition.

Thank you so much that you helped me to find a solution :)

Have a happy NYE & best regards,
Fabian
Hey Tero, thank you that you investigated in my topic. Unfortunately I can't add an initial flow velocity, because the my massflow parameter is fixed. But your advice with "outflow" gave me a hint. I figured out that in the "outlet" condition I selected "laminar outflow to exit pressure" with a too short exit length (although the simulation always succeeded in the past). As soon as I put in a longer exit length, the model is working again. Even without the "outflow" boundary condition. Thank you so much that you helped me to find a solution :) Have a happy NYE & best regards, Fabian

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.