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

Function with parameters

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 16, 2011, 10:42
Default Function with parameters
  #1
Disabled
 
Join Date: Aug 2011
Posts: 10
Rep Power: 14
foo7 is on a distinguished road
Hello guys.

I'm trying to simulate a multicomponent gas flow.
The gas has more than 20 different components, each one with different properties.
The heat capacity of each component follows the following law:

Cp(a,b,c,d,e,T) = a*T +b*(T^2)+c*(T^-1) +d*(e)

Where a,b,c,d and e are parameters which differ from component to component and T is the gas temperature.

I'd like to know if there's a way within CFX for me to write this function Cp(a,b,c,d,e,T) and call it within the materials properties.

This way, when I'm setting each components properties I don't need to write the whole expression, just call the Cp(a,b,c,d,e,T) with the appropriate parameters a,b,c,d and e.

thanks a lot
foo7 is offline   Reply With Quote

Old   September 17, 2011, 08:09
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You cannot do CEL functions like this. You can write a fortran subroutine to do it. But I would just write it all out in CEL. Using a text editor it should not be too hard to knock up the CEL expressions for each of the 20 components.

I realise this is not "elegant" and a computer scientist would choke on his weeties, but it should work, is straightforward and will get the job done.
ghorrocks is offline   Reply With Quote

Reply

Tags
cel, expression, function

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
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 01:35
[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 16:50.