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.

Can the Initial Value (Temperature) be expressed using a function?

Please login with a confirmed email address before reporting spam

Hi, everyone,

I’m using the “heat transfer” module to construct my model. Traditionally, the ”Initial Value” node is only set into a constant value, usually 295.13 [K] or 300 [K]. I want to set the ”Initial Value” node into a function (external matlab function with the aid of Matlab or an analytic one in COMSOL), which means the initial temperature in the geometrical area is a function relative to the location(x, y).

For example, the initial temperature is a function and can be expressed as “293.15*x^2”, I defined a analytic function “an3= x^2”, so the expression in the initial value (temperature) tablet is set as “293.15[K]*an3(x[1/m])”. All are illustrated in Fig. 1, but it doesn’t work.

(photo is in the attachment)

Is there anyone can give me some tips and guidance? Could the “Initial Value” node finish (fulfill) this task?
(p.s. franking speaking, the example is simple, so there is no need to build an analytic function in global definitions)

Thanks sincerely in advance.
Best wishes to you and your family.

FM Huang
Dec. 4th.2011


2 Replies Last Post 31 mag 2012, 05:24 GMT-4
Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 dic 2011, 18:00 GMT-5
Yes. Create your function in the function portion of the model tree. There is even a check box to specify that the function is a function of the spatial variables. Then refer to this same function in the initial values portion of the model tree. It is quite natural setup. Nothing special or fancy needed. If you prefer to use a MATLAB function, this can also be done as well, but not necessary.
Yes. Create your function in the function portion of the model tree. There is even a check box to specify that the function is a function of the spatial variables. Then refer to this same function in the initial values portion of the model tree. It is quite natural setup. Nothing special or fancy needed. If you prefer to use a MATLAB function, this can also be done as well, but not necessary.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 31 mag 2012, 05:24 GMT-4
Good moorning Mr. James D. Freels
thanks for your post. I have a question: there is some problems to make a function where the variabiles are the coordinates? I will use this one for specifide initial values!

Thanks for your answere,

Simone
Good moorning Mr. James D. Freels thanks for your post. I have a question: there is some problems to make a function where the variabiles are the coordinates? I will use this one for specifide initial values! Thanks for your answere, Simone

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.