|
[Sponsors] |
Please Help, Using UDF to Import Velocity Data -- But All Zeros :( |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 10, 2009, 16:47 |
Please Help, Using UDF to Import Velocity Data -- But All Zeros :(
|
#1 |
New Member
明月出天山
Join Date: Jun 2009
Posts: 6
Rep Power: 17 |
Hello, Friends
I am using Fluent UDF to import velocity from local data files. But the output are always zero, I tested the C program by local c compiler, it works great as what I expected. Please, please take a look at my UDF and let me know what you believe are wrong, thanks a lot! #include "udf.h" #include "mem.h" #include <stdio.h> int Nz = 512; int ts, n; char buffer[50]; real u, v, w; DEFINE_PROFILE(x_velocity, t, i){ FILE *fid; face_t f; /************************* Construct fine names here **************************/ ts = N_TIME; n = sprintf(buffer, "Uf_%i.dat", ts % Nz); Message("Importing x-velocity from %s...", buffer); fid = fopen(buffer, "r"); begin_f_loop(f, t){ fscanf(fid, "%f %f %f\n", &u, &v, &w);<=== u, v, w read from here are always zeros /* printf("u = %f, u = %f, u = %f\n", u, v, w);*/ F_PROFILE(f,t,i) = u; } end_f_loop(f,t) fclose(fid); Message("Done\n"); } The data files look like this below 7.241065 -8.430264 85.50916 -9.164535 -1.508738 82.77167 10.84698 -2.585959 90.85329 -3.974935 -2.802197 92.33000 ... ... |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
unsteady inlet velocity udf | jill | FLUENT | 8 | February 10, 2015 07:04 |
DPM UDF particle position using the macro P_POS(p)[i] | dm2747 | FLUENT | 0 | April 17, 2009 02:29 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |
I-DEAS CAD data import with boundary conditions | Yunus | Siemens | 1 | June 1, 2001 11:04 |