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.

2D interpolation of material properties as function of Temperature and Pressure?

Please login with a confirmed email address before reporting spam

Hi, I see that COMSOL 4.2a allows 2D interpolations, how would that be used to interpolate fluid properties, such as density, conductivity, cp, etc, as functions of temperature and pressure of the system? I have created tables of values from NIST at various temperatures and pressures but am not sure how to import that all into COMSOL and call it for the various pressure and temperatures.

7 Replies Last Post Mar 3, 2015, 3:29 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 24, 2012, 2:14 p.m. EDT
Have you tried using 1D interpolation using text file for data input? Essentially, it's the same for 2D.
Have you tried using 1D interpolation using text file for data input? Essentially, it's the same for 2D.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 24, 2012, 7:33 p.m. EDT
Yes, I am capable of doing the 1D interpolation and creating the function from that, however, I am having difficulty figuring out how to extend that to two parameters, such as a density that is a function of temperature and pressure and would be interpolated based on both of their values.

Yes, I am capable of doing the 1D interpolation and creating the function from that, however, I am having difficulty figuring out how to extend that to two parameters, such as a density that is a function of temperature and pressure and would be interpolated based on both of their values.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 24, 2012, 7:59 p.m. EDT
1. create data file with 3 columns: P,T,f(P,T)
2. define interpolation function (say int1), use data from the file
3. make sure you defined the int. function correctly. Just click the "plot" button to plot it
4. now you can use the function int1(P,T) to define material properties. Just make sure to fix the units for P and T so the text field appears in black, not in red or yellow color.
1. create data file with 3 columns: P,T,f(P,T) 2. define interpolation function (say int1), use data from the file 3. make sure you defined the int. function correctly. Just click the "plot" button to plot it 4. now you can use the function int1(P,T) to define material properties. Just make sure to fix the units for P and T so the text field appears in black, not in red or yellow color.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 31, 2012, 12:58 p.m. EDT
HI,

Could you please expand on the properly defining the function int1? I have uploaded data with three columns the first column is Temperature the second column is pressure and the third is the density as as a function of the two.

Should the data for sure be in columns? and should there be column headings in the data file?

Would it be possible for you to send me a quick screenshot of how you have set up a 2D interpolation? It would be great help because I feel like I am doing everything you have stated but I am getting numerous errors related to improper number of functions and arguments, etc.

Thanks.

Chris
HI, Could you please expand on the properly defining the function int1? I have uploaded data with three columns the first column is Temperature the second column is pressure and the third is the density as as a function of the two. Should the data for sure be in columns? and should there be column headings in the data file? Would it be possible for you to send me a quick screenshot of how you have set up a 2D interpolation? It would be great help because I feel like I am doing everything you have stated but I am getting numerous errors related to improper number of functions and arguments, etc. Thanks. Chris

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 11, 2013, 10:08 a.m. EST
Hi,
Have you succeeded to creat 1D interpolation?
I have some problems about how to create interpolation function on temperature-dependent thermal conductivity. I have made a .txt file with two columns (the first column is the Temperature, and the second one is thermal conductivity).
But i have no idea how to insert the text into Material Contents. I typed the function name in the blank of "Value", but the font color is always yellow. It always comes out as "The following feature has encountered a problem: Failed to evaluate variable Jacobian....."

Do you know why this happened?
Hi, Have you succeeded to creat 1D interpolation? I have some problems about how to create interpolation function on temperature-dependent thermal conductivity. I have made a .txt file with two columns (the first column is the Temperature, and the second one is thermal conductivity). But i have no idea how to insert the text into Material Contents. I typed the function name in the blank of "Value", but the font color is always yellow. It always comes out as "The following feature has encountered a problem: Failed to evaluate variable Jacobian....." Do you know why this happened?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 11, 2013, 2:40 p.m. EST
In the Value field, you need to write the function with the argument: my_function(my_variable).
In the Value field, you need to write the function with the argument: my_function(my_variable).

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Mar 3, 2015, 3:29 a.m. EST

1. create data file with 3 columns: P,T,f(P,T)
2. define interpolation function (say int1), use data from the file
3. make sure you defined the int. function correctly. Just click the "plot" button to plot it
4. now you can use the function int1(P,T) to define material properties. Just make sure to fix the units for P and T so the text field appears in black, not in red or yellow color.


Thanks. Very helpful tips.

[QUOTE] 1. create data file with 3 columns: P,T,f(P,T) 2. define interpolation function (say int1), use data from the file 3. make sure you defined the int. function correctly. Just click the "plot" button to plot it 4. now you can use the function int1(P,T) to define material properties. Just make sure to fix the units for P and T so the text field appears in black, not in red or yellow color. [/QUOTE] Thanks. Very helpful tips.

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.