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.

Error in user-defined function

Please login with a confirmed email address before reporting spam

Hi everybody,
I would like to use the PDE mode to solve a coupled problem of heat transfer and fluid flow in a porous media under freezing. I have three dependent variables : temperature, liquid pressure and the displacement. For the nonlinear study, i would like to introduce a function Sc(T) who describes the dependance of the fraction of pore volume occupied by ice crystal (that i note Sc) on the temperature T. Thus, I defined an analytical function and i called it in the coefficient of PDE, then the following error message appears:

Nonlinear solver did not converge.
Time : 0
Error in user-defined function.
Function: mod1.Sc
Failed to evaluate expression.
Expression: d((-(-2*(K+4*G/3)*mod1.u-b*x^2*mod1.pLx*unit Pa cf/unit m cf-(alpha*K-b*mod1.Sc(mod1.T)*sigmaf)*x^2*mod1.T)*test(mod1.u)+(K+4*G/3)*x^2*mod1.ux*test(mod1.ux))*(dvol),{test@0})
Last time step is not converged.

I tried to replace the function Sc(T) by an another linear function and it works. Then, in the PDE of displacement (u), I replaced Sc(T) by its derivation d(Sc(T),T) and it can be solved. I don't know why the model doesn't accept my function introduced in the PDE's coefficient.

Please help me to find out where is the problem. Thanks a lot!


0 Replies Last Post 17 mar 2014, 11:17 GMT-4
COMSOL Moderator

Hello Nguyen Hai Trung

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.