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

UDF programing

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2016, 23:47
Default UDF programing
  #1
New Member
 
m.n
Join Date: Jul 2016
Posts: 2
Rep Power: 0
mostafa.n.229@gmail.com is on a distinguished road
Hello
I want to write a udf in fluent.
How can i save the coordinate of zone's cells in a part of a domain in a (((.txt)))file?
Thanks a lot.
mostafa.n.229@gmail.com is offline   Reply With Quote

Old   July 25, 2016, 01:03
Default
  #2
New Member
 
m.n
Join Date: Jul 2016
Posts: 2
Rep Power: 0
mostafa.n.229@gmail.com is on a distinguished road
Hello
How can save all for example a varriable which is acted in some cells in a thread ?
for eample i want to save all variation in cells for source term in this code?
how can i do?
thanks

#include "udf.h"
#include "stdio.h"
#define RO 1.222
#define k 4
#define V 10
#define R 60
#define q 2.83
#define cl 0.5
#define cd 0.6
DEFINE_SOURCE(momentom_x_source,c,t,dS,eqn)
{FILE *pf;

real source;
cell_t c;
face_t f;
Thread *c_thread;
real position[ND_ND];

//real phi[25];
real x,y,U,i;
begin_c_loop(c,t)
{
C_CENTROID(position,c,t);
x=position[0];
y=position[1];
for(i=1;i=25;i++)
C_UDMI(c,t,i)=y;
end

source=C_U(c,t)*y;
dS[eqn]=y;
}
end_c_loop(c,thread)

if(NULL == (pf = fopen("ffff.txt","a")))
Error("Could not open file for append!\n");
fprintf(pf,"%f\n",source);
fclose(pf);
return source;
}
mostafa.n.229@gmail.com 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 Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
Parallelize UDF? Which kind of UDF? Lilly FLUENT 5 March 25, 2014 02:05
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 09:01
Programing a UDF poper FLUENT 3 January 31, 2008 03:27
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 09:44.