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

load txt file in fluent

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 6, 2012, 14:33
Default load txt file in fluent
  #1
Member
 
Yolk
Join Date: Nov 2011
Posts: 37
Rep Power: 5
Yannian is on a distinguished road
Hi everyone,
Where should I put the txt file when I want to load it? Is it in the same document as case file and udf or in somewhere different?
Yannian
Yannian is offline   Reply With Quote

Old   March 6, 2012, 16:13
Default
  #2
Member
 
Yolk
Join Date: Nov 2011
Posts: 37
Rep Power: 5
Yannian is on a distinguished road
This is the code, Please point out what's wrong with the code and which directory the 'p.txt' should be put in.
Thanks!
Yannian

#include "udf.h"
DEFINE_PROFILE(pressure_inlet,thread,index)
{
FILE *fp;
int i;
real xp[16];
face_t f;
fp = fopen("p.txt","r");
for (i=1; i<16; i++)
{
fscanf(fp, "%f", &xp[i]);
}
for (i=1; i<16; i++)
{
Message("%3.2f",xp[i]);
}
printf("\n");
fclose(fp);
i=1;
begin_f_loop(f,thread) /* loops over all faces in the thread passed in the DEFINE macro argument */
{
F_PROFILE(f,thread,index) = radexp[i];
i=i+1;
}
end_f_loop(f,thread)
}
Yannian 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
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
paraview installation woes vex OpenFOAM Installation 15 January 30, 2011 08:11
OpenFOAM Install Script ljsh OpenFOAM Installation 82 October 12, 2009 11:47
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51


All times are GMT -4. The time now is 22:51.