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

Initialize and read a file contents

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2005, 08:26
Default Initialize and read a file contents
  #1
David Baker
Guest
 
Posts: n/a
Hi,

I have wrote below udf to read some data from a file. I got error. What is wrong? I think file doesn't open.

-----------------------------

#include "udf.h"

real inlet[2000][2];

int NI;

char *fname1="d:\\prj\\unsteady\\rpm3500\\inlet.dat";

DEFINE_INIT(initializ,d)

{

FILE *fp;

int i;

fp=fopen(fname1,"r");

fscanf(fp,"%d\n",NI);

fscanf(fp,"%f %f\n",&inlet[i][1],&inlet[i][2]);

printf("NI=%d\n",NI);

fclose(fp);

}

------------------------------
  Reply With Quote

Reply


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
fluent 12.1, batch mode in linux sakalido FLUENT 13 September 27, 2017 08:55
Initialize a volScalarFiedl with wordList of patch types tgillebaart OpenFOAM Programming & Development 0 February 9, 2011 08:34
Changing the grid on the same set-up Katya FLUENT 7 October 8, 2009 16:31
a question about initialize in fluent zhaopu FLUENT 0 December 29, 2008 05:52
On how to initialize a UDS Angelo Sozzi FLUENT 2 November 19, 2003 16:31


All times are GMT -4. The time now is 16:28.