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

File operation in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2004, 16:33
Default File operation in UDF
  #1
Ajay
Guest
 
Posts: n/a
Hi All,

I need to read in 7 different values at every time step into my UDF my txt file has all the data in 7 columns and 100 rows . I need to read the first row at the first time iteration and then the second row and so on. Fseek doesnt work with interpreted UDF. I wanted to know how i can accomplish the tasks

I am illustrating my data here

time r theta z Re concentration shear 11 12 13 14 15 16 17 21 22 23 24 25 26 27 ..................................... etc

part of my UDF

DEFINE_EXECUTE_AT_END (exec_at_end) {

FILE *fptr; fptr = fopen("pthc.10_1_10c.txt","r")); fseek(fptr,f_counter,SEEK_SET); fscanf("%f %f %f %f %f %f %f ",&time,&r,&theta,&z,&rno,&cdom,&shear);

fclosef(fptr);

f_counter=f_counter+70; } How to do it without using Fseek ? thanks Ajay

  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
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 13:43
[OpenFOAM] Paraview command not found hardy ParaView 7 September 18, 2008 04:59
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


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