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.

Interpolation

Please login with a confirmed email address before reporting spam

Hi,
I am modeling heat transfer and fluid flow and water is circulating through a U-pipe embedded in a cylinder of soil.
I am trying to define a table (interpolation) for depth dependent temperature profile and need to use it as a boundary condition for far filed temperature.
I define it in definitions and it is named int1 but when i want to recall it for the boundary condition (farfiled temperature) it only accepts if I define it :int1(T[1/degC]). is this a correct way to recall the table?

thanks
ASAL

7 Replies Last Post 2012年6月26日 GMT-4 19:19

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年6月20日 GMT-4 21:56
sorry forgot to say that results obtained are not reasonable at all. should I define a variable or parameter first?
the table basically is the far-field temp profile in y direction.
I also tried int1(y[1/m]) in the boundary condition but did not work either.

ASAL
sorry forgot to say that results obtained are not reasonable at all. should I define a variable or parameter first? the table basically is the far-field temp profile in y direction. I also tried int1(y[1/m]) in the boundary condition but did not work either. ASAL

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 2012年6月21日 GMT-4 00:49
Hi

read carefully how to treat temperatures, in absolute and relative, the difficulty in the beginning is the units when to consider ir relative hence for DT [K] == [degC] but when considering it in absolute T0[K] = T0[degC]+273.15

if you have a material interpolation function that isusing T0 in absolute but based on °C you should write int1(T[1/degC]) as for COMSOl, by default in SI T is in Kelvin, by writing it with the previous 1/units you get a numerical value transformed into Celsius and from which the units are removed, this is the standard way to enter an argument to an operator that motly do not expect units. If your int1 of T is based on Kelvin values you should write int1(T[1/K]), its with or without the asolute offset of 273.15

int1(y[1/m]) is something else, but again, what is int1 doing ? here you provide the Y coordinate in number as per meter (but with units removed). Is you interpolation function argument supposed to be a spatial dimension or a temperature (I'm wundering if its T out for position in hence intop1(y[1/m])*1[degC] or *1[K], note this is not the same

Conclusion check what you are doing with temperatures its easy to get it offset as input or as output ;)

--
Good luck
Ivar
Hi read carefully how to treat temperatures, in absolute and relative, the difficulty in the beginning is the units when to consider ir relative hence for DT [K] == [degC] but when considering it in absolute T0[K] = T0[degC]+273.15 if you have a material interpolation function that isusing T0 in absolute but based on °C you should write int1(T[1/degC]) as for COMSOl, by default in SI T is in Kelvin, by writing it with the previous 1/units you get a numerical value transformed into Celsius and from which the units are removed, this is the standard way to enter an argument to an operator that motly do not expect units. If your int1 of T is based on Kelvin values you should write int1(T[1/K]), its with or without the asolute offset of 273.15 int1(y[1/m]) is something else, but again, what is int1 doing ? here you provide the Y coordinate in number as per meter (but with units removed). Is you interpolation function argument supposed to be a spatial dimension or a temperature (I'm wundering if its T out for position in hence intop1(y[1/m])*1[degC] or *1[K], note this is not the same Conclusion check what you are doing with temperatures its easy to get it offset as input or as output ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年6月21日 GMT-4 21:28
thanks a lot Ivar.

my table consists of depth (t) and temperature (f(t)) in Celsius and is called int1. the function argument is depth (y).
thanks a lot Ivar. my table consists of depth (t) and temperature (f(t)) in Celsius and is called int1. the function argument is depth (y).

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 2012年6月22日 GMT-4 04:58
Hi

when I work on these functions with temperature, I mostly make an analytical function of the full expression I use in the BC field, and plot it with the plot command to be sure the unit transformation is handled correctly. Thereafter my simulations results are also mostly correct

--
Good luck
Ivar
Hi when I work on these functions with temperature, I mostly make an analytical function of the full expression I use in the BC field, and plot it with the plot command to be sure the unit transformation is handled correctly. Thereafter my simulations results are also mostly correct -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年6月24日 GMT-4 20:55
Hi Ivar,
even if I define the function analytically and get rid of the table it doesn't make any difference and when i want to define the BC, it is still not defined.
i thought it should be much easier that these as explained in the manual. defining either a table or a function and using it in the BC accordingly.
Hi Ivar, even if I define the function analytically and get rid of the table it doesn't make any difference and when i want to define the BC, it is still not defined. i thought it should be much easier that these as explained in the manual. defining either a table or a function and using it in the BC accordingly.

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 2012年6月25日 GMT-4 02:32
Hi

indeed it should be straightforward, you can set the units in the interpolation function (lower part of the tab

Is it something like this ? I have two "int" one in kelvin and one in degC, if you define the units in the interpolation function you do not need to use the y[1/m] and *1[K] when calling the function

--
Good luck
Ivar
Hi indeed it should be straightforward, you can set the units in the interpolation function (lower part of the tab Is it something like this ? I have two "int" one in kelvin and one in degC, if you define the units in the interpolation function you do not need to use the y[1/m] and *1[K] when calling the function -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年6月26日 GMT-4 19:19
thanks Ivar. it worked.
i just defined the units in the function definition (units for argument and function) and recalled the function in the BC.

thanks for being helpful to comsol users.

ASAL
thanks Ivar. it worked. i just defined the units in the function definition (units for argument and function) and recalled the function in the BC. thanks for being helpful to comsol users. ASAL

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.