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.

How to set units for spreadsheet interpolation functions

Please login with a confirmed email address before reporting spam

Hi everyone,

I am using interpolation functions as part of my user-defined material of supercritical nitrous oxide.

  1. I created a single file containing all the necessary properties from REFPROP 9.1 like this:
%generated by refprop 9.1
%T(K)   P(MPa)  rho(kg/m^3) Cp(kJ/kg/K) Cp/Cv(1)    k(mW/m/K)   mu(uPa*s)
253.15  8   1023.00991952422    1.87478181419069    2.05862096967249    133.59295029882 123.111262318369
259.15  8   999.687331636415    1.91519420464732    2.10639877679575    127.442508528812    114.379782308368
265.15  8   975.107703547733    1.96439137197161    2.16285754923595    121.274960352074    106.229100271817
271.15  8   948.992870033893    2.02552466499771    2.23120949426288    115.078351346467    98.5329513547296
277.15  8   920.952036990524    2.10368706490453    2.31658227212712    108.836909650465    91.1699309861214
  1. I import it as spreadsheet in interpolation function node;
  2. I set the correct positioning of the interpolation functions: rho_int as position 1, Cp_int as position 2, etc;
  3. Interpolation is linear and extrapolation is constant as default setting;
  4. In units setting, I set arguments as K, MPa, but I cannot specify units for Function.

    I got error

    Syntax error in expression.
    - Expression: kg/m^3, kJ/kg/K, 1, mW/m/K, uPa*s
    - Subexpression: , kJ/kg/K, 
    - Position: 7
    - Function: root.comp1.mat2.def.rho_int
    - Property: mquantitymatrix (Output properties)
    

    when I set it as 1,1,1,1,1 or kg/m^3, kJ/kg/K, 1, mW/m/K, uPa*s.

    I can only leave it blank or set it to 1 and use the functions as unitless, which means I have to set Density in Basic properties as rho_int(T,pA)[kg/m^3] rather than rho_int(T,pA).

FYI, I am using: comsol version: 5.4 build 225 OS: windows 10, 64bit

Any idea? I do not know if it is possible to assign unit for each function in newest comsol. But I think it would be more straight forward to do that.

p.s. The attachment is the spreadsheet file I am using.



1 Reply Last Post 19 févr. 2020, 21:31 UTC−5

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 19 févr. 2020, 21:31 UTC−5

I tried to use {kg/m^3, kJ/kg/K, 1, mW/m/K, uPa*s}, it does not report error, but the function name in property expression is showing yellow color.

I tried to use `{kg/m^3, kJ/kg/K, 1, mW/m/K, uPa*s}`, it does not report error, but the function name in property expression is showing yellow color.

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.