
[Sponsors] 
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:
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 => 19228E04 8.87642*10^7 => 8.87642E07 (...) 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 = 19228E04 [kg/(m^3 K^2)] D = 8.87642E7 [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 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
is internalField(U) equivalent to zeroGradient?  immortality  OpenFOAM Running, Solving & CFD  7  March 29, 2013 01:27 
Is there a limit for CEL expression length?  fml2  CFX  2  March 27, 2012 02:20 
latest OpenFOAM1.6.x from git failed to compile  phsieh2005  OpenFOAM Bugs  25  February 9, 2010 04:37 
junction box routine and CEL function  bornspur  CFX  2  February 3, 2009 02:24 
[blockMesh] Axisymmetrical mesh  Rasmus Gjesing (Gjesing)  OpenFOAM Meshing & Mesh Conversion  10  April 2, 2007 14:00 