|
[Sponsors] |
September 16, 2011, 10:42 |
Function with parameters
|
#1 |
Disabled
Join Date: Aug 2011
Posts: 10
Rep Power: 15 |
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 |
|
September 17, 2011, 08:09 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144 |
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. |
|
Tags |
cel, expression, function |
|
|
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 |