|
[Sponsors] |
March 6, 2012, 14:33 |
load txt file in fluent
|
#1 |
Member
Yolk
Join Date: Nov 2011
Posts: 38
Rep Power: 15 |
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 |
|
March 6, 2012, 16:13 |
|
#2 |
Member
Yolk
Join Date: Nov 2011
Posts: 38
Rep Power: 15 |
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) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
paraview installation woes | vex | OpenFOAM Installation | 15 | January 30, 2011 08:11 |
OpenFOAM Install Script | ljsh | OpenFOAM Installation | 82 | October 12, 2009 12:47 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
Results saving in CFD | hawk | Main CFD Forum | 16 | July 21, 2005 21:51 |