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.

define heat capacity as a functin of temperature

Please login with a confirmed email address before reporting spam

Hi:
I'm trying to define my specific heat capacity as a function of temperature in V4.0, say

Cp = Cp1 for T < 400 K
Cp = Cp2 for T >= 400K

I've tried the Cp1*(T<400 ) and heaviside functions, but Comsol kept on failing to solve for the variable,

anyone can help ???

thanks

Spencer

4 Replies Last Post 21 feb 2011, 18:06 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 18 feb 2011, 10:22 GMT-5
Hi

Have you tried to interpolate on a list of numerical data with a function ?

--
Good luck
Ivar
Hi Have you tried to interpolate on a list of numerical data with a function ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 feb 2011, 12:20 GMT-5

Hi

Have you tried to interpolate on a list of numerical data with a function ?

--
Good luck
Ivar


dear Ivar,
thanks for your advice, i've done two interpolation functions and they seem to be working.

however there seems to be a problem, it used to take abt 10mins to run a simulation and now it's taking hours if not days, ( it's actually still running at this very moment ), is this normal ??

thanks so much !

Spencer
[QUOTE] Hi Have you tried to interpolate on a list of numerical data with a function ? -- Good luck Ivar [/QUOTE] dear Ivar, thanks for your advice, i've done two interpolation functions and they seem to be working. however there seems to be a problem, it used to take abt 10mins to run a simulation and now it's taking hours if not days, ( it's actually still running at this very moment ), is this normal ?? thanks so much ! Spencer

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 feb 2011, 12:48 GMT-5
Hi

could be, but it is really difficult to say like that. Normally if you replace a constant material parameter by a temperature or pressure dependent one, and that T and/or p are part of you simulation you are getting a non-linear probelem, that might need to iterate several times to find a valid solution.

So you must check the convergence of the solver, often following the results with a probe or a useful plot helps to identify if the system converges or are just running away.

It is clear that a few hours running, in blind, is not very encourraging. You might STOP the solver look at th results and RESTART from current location. This might also help the convergence, some times

--
Good luck
Ivar
Hi could be, but it is really difficult to say like that. Normally if you replace a constant material parameter by a temperature or pressure dependent one, and that T and/or p are part of you simulation you are getting a non-linear probelem, that might need to iterate several times to find a valid solution. So you must check the convergence of the solver, often following the results with a probe or a useful plot helps to identify if the system converges or are just running away. It is clear that a few hours running, in blind, is not very encourraging. You might STOP the solver look at th results and RESTART from current location. This might also help the convergence, some times -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 feb 2011, 18:06 GMT-5
did you try the if operator?
you could define Cp as a variable:
Name: Cp
Expression: if(T<400,Cp1,Cp2)
did you try the if operator? you could define Cp as a variable: Name: Cp Expression: if(T

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.