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

load txt file in fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2012, 13:33
Default load txt file in fluent
  #1
Member
 
Yolk
Join Date: Nov 2011
Posts: 38
Rep Power: 14
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, 15:13
Default
  #2
Member
 
Yolk
Join Date: Nov 2011
Posts: 38
Rep Power: 14
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


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
paraview installation woes vex OpenFOAM Installation 15 January 30, 2011 07: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 14:48.