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

Initialize and read a file contents

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

Reply
 
LinkBack Thread Tools 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

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


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