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

who can help me about my udf on piston...

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2008, 12:34
Default who can help me about my udf on piston...
  #1
sweetcherry
Guest
 
Posts: n/a
hi,every one, i have to use udf on my research, i read many information about udf,but i still don't know what's the problem in my case. when i do iterate the case, it will shows the error.i think it is the udf problem. i hope someone can help me to tell me where the problem is ! here is my udf!

#include <stdio.h> #include "udf.h" # define UDF_FILENAME "piston.dat" # define PI 3.141592654 FILE *fp; //6 DEFINE_CG_MOTION(pistona, dt, cg_vel, cg_omega, time, dtime) { Thread *t=DT_THREAD (dt); face_t f; real force, loc; real velo, pressure; // real v1, v2, v3; fp= fopen("piston.dat","w"); NV_S(cg_vel,=,0.0); NV_S(cg_omega,=,0.0); if (!Data_Valid_P ())

return; force=0.0;

begin_f_loop(f,t) {

real *AA;

AA = F_AREA_CACHE (f, t);

force += F_P (f, t) * AA[0]; } end_f_loop (f, t) if (rp_axi)

force *= 2.0 * M_PI; pressure = force / 0.0099*0.0099*M_PI;

# define rp 0.0067 # define l1 0.079 # define rpm 500. / # define w 2.*PI*rpm/60. # define q w*dtime

velo = rp*w*sin(PI/2.-q)+1./sqrt(2.*rp*cos(PI/2.-q)* 2.*rp*cos(PI/2.-q)-4.*(rp*rp-l1*l1))*(2.*rp*cos(PI/2.-q)) *rp*sin(PI/2.-q)*(w);

loc = 0.01945+0.02+rp*cos(PI/2.-q)+0.5*sqrt ((2.*rp*cos(PI/2.-q))*(2.*rp*cos(PI/2.-q))-4.*(rp*rp-l1*l1));

fprintf (fp, "%e %e %e %e\n", time, loc, velo, dtime);

cg_vel[0]=velo;

fclose (fp);

message ("\nUDF valve: time = %f, loc(m)= %f,

velo = %f, dtime = %f\n", time, loc

,velo,dtime);

}
  Reply With Quote

Old   May 15, 2008, 02:48
Default Re: who can help me about my udf on piston...
  #2
mAx
Guest
 
Posts: n/a
what is exactly the error message? (while solving? while compiling?)
  Reply With Quote

Reply


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
who can help me about my udf on piston... venus FLUENT 1 May 28, 2014 11:37
CFX Piston Motion (CEL) Dante CFX 4 May 28, 2012 07:08
Mexican hat piston Amida Oluwole Main CFD Forum 0 June 12, 2007 07:12
Piston Motion A Student Siemens 0 April 18, 2006 12:36
piston motion Arpan Siemens 1 March 9, 2006 08:52


All times are GMT -4. The time now is 20:24.