# CEL expression with cubic function

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 21, 2014, 10:50 CEL expression with cubic function #1 New Member   Join Date: Nov 2013 Posts: 18 Rep Power: 12 Hi, I am looking to define a specific oil that I have used and need to input its properties into CFX. They density, Kinematic Viscosity and Heat capacity are defined by cubic functions which are all similar this 885.597 - (0.689367(T [C]))+(19228*10^-04*(T [C])^2)-(8.87642*10^-7*(T [C])^3) However when I plot this, CFX says I have an error either side of the '-' sign at position 8. Correcting that to [C], the error moves along...Has anyone got a solution to this. I'm sure it's staring me in the face Please & Cheers

 March 21, 2014, 13:14 #2 Senior Member   Edmund Singer P.E. Join Date: Aug 2010 Location: Minneapolis, MN Posts: 511 Rep Power: 21 (885.597 - (0.689367*(t/1 [k]))+(19228*10^-04*((t/1 [k]))^2)-(8.87642*10^-7*((t/1 [k]))^3))*1 [whatever units you need this in]

 March 22, 2014, 14:52 #3 New Member   Join Date: Nov 2013 Posts: 18 Rep Power: 12 Doesn't seem to like this. The generated plot is increasing, but the function is decreasing, with increasing temperature. I've also tried breaking it up, defining variables a, b & c, then adding/subracting them together, but no joy. Any further ideas?

 March 23, 2014, 04:18 #4 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 17,789 Rep Power: 143 Some comment: Are you sure the original function is correct? It might be wise to not assume the order of operations is as you expect - for instance the section 8.87642*10^-7*(t/1[k]) could be interpreted as: 8.87642*10^(-7*(t/1[k])) 8.87642*(10^-7)*(t/1[k]) (8.87642*10)^(-7*(t/1[k])) And these will all give very different answers. So I would put lots of brackets in the expression to make sure there is no assumed order of operations anywhere.

March 25, 2014, 16:36
#5
Senior Member

Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 277
Rep Power: 21
Quote:
 Originally Posted by magicalmarshmallow Hi, I am looking to define a specific oil that I have used and need to input its properties into CFX. They density, Kinematic Viscosity and Heat capacity are defined by cubic functions which are all similar this 885.597 - (0.689367(T [C]))+(19228*10^-04*(T [C])^2)-(8.87642*10^-7*(T [C])^3) However when I plot this, CFX says I have an error either side of the '-' sign at position 8. Correcting that to [C], the error moves along...Has anyone got a solution to this. I'm sure it's staring me in the face Please & Cheers
There are lots of problems in your equation. First, I'm not sure what you're trying to do with this:

0.689367(T [C])

but my guess is you're expecting CFX to use temperature in Celcius, which it won't do unless you change it in the Options (it defaults to SI, so Kelvin). A better option would be to rewrite your equation considering the temperature will be in [K].

Second, try using proper scientific number format:
19228*10^-04 => 19228E-04
8.87642*10^-7 => 8.87642E-07

(...)

Last, use the appropriate units for each constant. So, if this is for density, use something like:

A = 885.597 [kg/m^3]
B = -0.689367 [kg/(m^3 K)]
C = 19228E-04 [kg/(m^3 K^2)]
D = -8.87642E-7 [kg/(m^3 K^3)]
TCelsius = T - 273.15 [K]

rho = A + B * TCelsius + C * TCelsius^2 + D * TCelsius^3

Hope it helps.

 Tags cel, cubic function, material properties