CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF table (https://www.cfd-online.com/Forums/fluent-udf/97957-udf-table.html)

bephi February 29, 2012 04:44

UDF table
 
Dear all,

I would like to create an UDF where I define a table with 2 columns.
time | mass flow rate

Lets say at the end there are 100 times and 100 corresponding values.
Between these values a linear interpolation would be nice.

Is this difficult to handle? I always find time-dependent functions but nothing with certain values.

Thanks a lot in advance.

ComputerGuy March 1, 2012 21:29

I would simply read the values into a global 2-d array at the beginning of the run.

You'll need to write your own linear interpolation function, but if you're doing CFD it shouldn't be too hard ;)

Then, you can call the interpolation in your define profile function (for mass rate), passing it the actual flow time and returning a double which represents the mass flow rate.

If you need more help, let us know!

ComputerGuy

Quote:

Originally Posted by bephi (Post 346852)
Dear all,

I would like to create an UDF where I define a table with 2 columns.
time | mass flow rate

Lets say at the end there are 100 times and 100 corresponding values.
Between these values a linear interpolation would be nice.

Is this difficult to handle? I always find time-dependent functions but nothing with certain values.

Thanks a lot in advance.


bephi March 2, 2012 05:52

Hi and thanks for the answer. I solved it and it was much easier than I thought... :)


All times are GMT -4. The time now is 10:17.