CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

display data in UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 27, 2012, 11:11
Default display data in UDF
  #1
New Member
 
Join Date: May 2012
Posts: 8
Rep Power: 5
fleure_Jasmin is on a distinguished road
Hello
I managed to read discrete data from a txt file in UDF but the problem is how to display these data as fluent is interpreting the source file, to check if it is realy the same external data.
here is the UDF:

#include"udf.h"
DEFINE_ON_DEMAND(pt_source,c)

{
FILE *finp;
real xs[841],ys[841],zs[841];
real T[841][3];

int i,j,k;


finp=fopen("C:\\...\\source.txt","r");

for(i=1;i<841;i++)
fscanf(finp,"%f%f%f\n",&xs[i],&ys[i],&zs[i]);

fclose(finp);

for(i=1;i<841;i++)
{
T[i][0]=xs[i];
T[i][1]=ys[i];
T[i][2]=zs[i];

}
}
Do you have an idea about what should I add to achieve this?
Thanks for the help.
fleure_Jasmin is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I/O of a real value by "DEFINE_RW_FILE" (UDF) Pietro Asinari Fluent UDF and Scheme Programming 1 August 15, 2015 19:08
UDF save data to a file!! spk Fluent UDF and Scheme Programming 34 July 17, 2013 14:03
Discrete Data into a UDF Ginger_Giant Fluent UDF and Scheme Programming 0 April 26, 2011 11:10
Accessing profile data from a UDF ral007 Fluent UDF and Scheme Programming 0 March 22, 2011 11:29
UDF for Species Mass Fraction Gradient *IN SPECIFIC ZONE * -- e.g. along axis of sym. ksiegs2 Fluent UDF and Scheme Programming 0 February 27, 2011 13:55


All times are GMT -4. The time now is 00:06.