CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Simple UDF array question [Fluent]

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

LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2012, 01:41
Default Simple UDF array question [Fluent]
New Member
Join Date: Apr 2012
Posts: 28
Rep Power: 13
Patrick1 is on a distinguished road

Edit: Solved..array positions start at 0 and not 1 in C
I'm making a simple UDF that is defined by a matrix of values, but am having problems in actually getting the UDF the access the matrix properly. Here's the bones of my code:

real velocity; /*velocity value*/
real matrix[2]; /*1D array storing 2 velocity values*/
int value; /*variable describing the array position eg. column 1,2..*/



velocity=matrix[value]; /* <<<PROBLEM LINE /*
F_PROFILE(f, thread, position) = velocity;
This code does NOT work for me. However, if I replace the problem line with:

velocity=matrix[1]; or
then my code how can I access the matrix by an integer variable rather than by an actual integer?

Will post the full code if need be.


Last edited by Patrick1; April 19, 2012 at 05:28.
Patrick1 is offline   Reply With Quote



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
Problem with a simple UDF to calculate cell-averaged particle values kmayank FLUENT 1 January 18, 2011 01:40
question on UDF manual example ak6g08 FLUENT 0 June 25, 2009 11:58
UDF - Source Term Question Jacques FLUENT 0 December 8, 2008 13:40
Pb with simple Fluent UDF example for inlet francois FLUENT 0 October 9, 2008 10:34
easy UDF question Oleg FLUENT 4 March 17, 2008 07:07

All times are GMT -4. The time now is 14:08.