Internal error in piecewise expression evaluation

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   3 Replies   Last post: December 29, 2013 11:16pm UTC
Fabian Holz

Fabian Holz

December 26, 2013 12:42pm UTC

Internal error in piecewise expression evaluation

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Fabian Holz

Fabian Holz

December 27, 2013 8:31am UTC in response to Fabian Holz

Re: Internal error in piecewise expression evaluation

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"

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Tero Hietanen

Tero Hietanen

December 28, 2013 4:42pm UTC in response to Fabian Holz

Re: Internal error in piecewise expression evaluation

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Fabian Holz

Fabian Holz

December 29, 2013 11:16pm UTC in response to Tero Hietanen

Re: Internal error in piecewise expression evaluation

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines