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

using udf to read new position of nodes

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2017, 03:54
Default using udf to read new position of nodes
  #1
New Member
 
Join Date: Nov 2016
Posts: 18
Rep Power: 7
f.yn is on a distinguished road
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)

}
f.yn is offline   Reply With Quote

Old   March 30, 2020, 12:21
Default
  #2
New Member
 
Roberto
Join Date: May 2016
Posts: 17
Rep Power: 8
RobertoCirolini is on a distinguished road
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!
RobertoCirolini is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
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


All times are GMT -4. The time now is 15:10.