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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2014, 11:50
Default CEL expression with cubic function
  #1
New Member
 
Join Date: Nov 2013
Posts: 18
Rep Power: 10
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, 14:14
Default
  #2
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 18
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, 15:52
Default
  #3
New Member
 
Join Date: Nov 2013
Posts: 18
Rep Power: 10
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, 05:18
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 16,925
Rep Power: 132
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, 17:36
Default
  #5
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 277
Rep Power: 18
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:27
Is there a limit for CEL expression length? fml2 CFX 2 March 27, 2012 03:20
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
junction box routine and CEL function bornspur CFX 2 February 3, 2009 03:24
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 23:42.