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.

Using external file data for heat source

Please login with a confirmed email address before reporting spam

Hi all,

I am trying to solve a model for heat transfer in solids using external data as heat source input.
The geometric model is simple and composed of 3 separated bodies attached together by a 'union' operation and form a continuity.
As a heat source I am trying to use an external file which contain the heat production, in units of W/cm^3, in certain points within the geometry. The file looks like this:

% x y z Power
1 1 1 10.2
1 2 3 20.2
...
5 4 7 15.3

To read it, under Global Parameters, I defined an interpolation function where I choose interpolation 'linear' and extrapolation 'specific value' (set to zero). I imported the function and I can see a nice plot of it in the graphics window. .
Then, in the 'Heat transfer in solids' physics inside 'heat Source' I am trying to use this function.
I choose 'User defined' under 'General source' and write the function name (the one I created from the file in the 'Global Parameters'). Comsol marks the function name in orange and claim that 'the variable is unknown'.

What am I missing? How can I use this function as heat source?

Any help will be appreciated,
Alon

6 Replies Last Post Feb 3, 2015, 2:34 p.m. EST
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 Dec 17, 2012, 10:55 a.m. EST
Hi

You should rather use the Model Definition Function Interpolation, and enable the File import - spreadsheet tick ON Use space coordinates as arguments to get the full mapping, the latter exist only in the model function, not in the global, as these are normally geometry independent (=Global).

Thne orange is unit errors, if you do not define your arguments in COMSOL interpolation function as W/cm^2 then you need to multiply the numerical value by the appropriate unit value 1[W/cm^2]

Check it out on a simple example with and without units

space coordinates are in meters by default

--
Good luck
Ivar
Hi You should rather use the Model Definition Function Interpolation, and enable the File import - spreadsheet tick ON Use space coordinates as arguments to get the full mapping, the latter exist only in the model function, not in the global, as these are normally geometry independent (=Global). Thne orange is unit errors, if you do not define your arguments in COMSOL interpolation function as W/cm^2 then you need to multiply the numerical value by the appropriate unit value 1[W/cm^2] Check it out on a simple example with and without units space coordinates are in meters by default -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 25, 2012, 8:28 a.m. EST
a heated plate, how to use it can get a correct result during cooling process

appreciate you answer

thank you
a heated plate, how to use it can get a correct result during cooling process appreciate you answer thank you

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 25, 2012, 8:28 a.m. EST
a heated plate, how to use it can get a correct result during cooling process

appreciate you answer

thank you
a heated plate, how to use it can get a correct result during cooling process appreciate you answer thank you

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 Dec 25, 2012, 9:52 a.m. EST
Hi

what about solving a stationary case for the heating, and then follow by a time dependent study using the stationary case as initial conditions. In the latest version, you can also turn on or off BC by solver settings, and or use a Parameter t=0[s] as "switch" to change certain BC values (defined as Parameter for the stationary case, then the time series redefines it and run t over you defined range set

--
Good luck
Ivar
Hi what about solving a stationary case for the heating, and then follow by a time dependent study using the stationary case as initial conditions. In the latest version, you can also turn on or off BC by solver settings, and or use a Parameter t=0[s] as "switch" to change certain BC values (defined as Parameter for the stationary case, then the time series redefines it and run t over you defined range set -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 3, 2013, 10:05 a.m. EST
Thanks Ivar :)

Indeed I had a problem of units but not with the heat - I needed to say that it is a function of x,y,z. Only when I added these coordinates the data could be read.

Thanks again,
Alon
Thanks Ivar :) Indeed I had a problem of units but not with the heat - I needed to say that it is a function of x,y,z. Only when I added these coordinates the data could be read. Thanks again, Alon

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Feb 3, 2015, 2:34 p.m. EST
Hi

Can i set Heat Source like function? I mean for example if i have x^2+y^2+z^2 equation, which i must set like Heat Source. How i can do this? Thanks.
Hi Can i set Heat Source like function? I mean for example if i have x^2+y^2+z^2 equation, which i must set like Heat Source. How i can do this? Thanks.

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.