|
[Sponsors] |
August 20, 2017, 03:54 |
using udf to read new position of nodes
|
#1 |
New Member
Join Date: Nov 2016
Posts: 18
Rep Power: 9 |
hi everybody
i wrote this udf to read out data from a .txt file but the data written in x,y and z are wrong, almost nothing is written #include "udf.h" DEFINE_GRID_MOTION(grid_motion,domain,dt,time,dtim e) { int j; int i; int n; FILE *fd; float x[249]; float y[249]; float z[249]; face_t f; Thread *thread = DT_THREAD(dt); Node *v; fd = fopen("f2d22.txt", "r"); for (j=0; j<250; j++) fscanf(fd,"%e,%e,%e\n", &x[j] ,&y[j], &z[j]); fclose(fd); /* printf("%e,%e,%e\n", x[1] ,y[1], z[1]); */ i = 0; begin_f_loop (f, thread) { f_node_loop (f, thread, n) { v = F_NODE (f, thread, n); i = i+1; NODE_X(v) = x[i]; NODE_Y(v) = y[i]; NODE_Z(v) = z[i]; } } end_f_loop (f, thread) } |
|
March 30, 2020, 12:21 |
|
#2 |
New Member
Roberto
Join Date: May 2016
Posts: 17
Rep Power: 9 |
Dear f.yn,
I would like to know if you have solved your problem and if you could give me some hints on how to solve it. I am facing a similar problem and in my case I want that the udf read the node positions exported from ansys APDL. best regards! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to read in data (problem executing) | ejpostema | Fluent UDF and Scheme Programming | 9 | November 9, 2016 06:57 |
Fluent Radiation/porous media | Schmitt pierre-Louis | FLUENT | 26 | September 1, 2016 10:29 |
[ANSYS Meshing] Need help Read nodes mesh and variable data!!!!! | lehoanganh07 | ANSYS Meshing & Geometry | 0 | March 18, 2014 01:41 |
UDF to read cell var. based on particle position | CeesH | Fluent UDF and Scheme Programming | 2 | February 24, 2014 10:21 |
read boundary conditions with udf | Bernhardt | FLUENT | 0 | May 31, 2007 09:46 |