CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

CEL expression with cubic function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2014, 10:50
Default CEL expression with cubic function
  #1
New Member
 
Join Date: Nov 2013
Posts: 18
Rep Power: 12
magicalmarshmallow is on a distinguished road
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
magicalmarshmallow is offline   Reply With Quote

Old   March 21, 2014, 13:14
Default
  #2
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
(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]
singer1812 is offline   Reply With Quote

Old   March 22, 2014, 14:52
Default
  #3
New Member
 
Join Date: Nov 2013
Posts: 18
Rep Power: 12
magicalmarshmallow is on a distinguished road
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?
magicalmarshmallow is offline   Reply With Quote

Old   March 23, 2014, 04:18
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   March 25, 2014, 16:36
Default
  #5
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 277
Rep Power: 21
brunoc is on a distinguished road
Quote:
Originally Posted by magicalmarshmallow View Post
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.
brunoc is offline   Reply With Quote

Reply

Tags
cel, cubic function, material properties


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 OpenFOAM-1.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


All times are GMT -4. The time now is 13:57.