CFD Online Logo CFD Online URL
Home > Forums > FLUENT

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

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

Like Tree1Likes
  • 1 Post By venus

LinkBack Thread Tools Display Modes
Old   August 11, 2008, 05:25
Default who can help me about my udf on piston...
Posts: n/a
Sponsored Links
i have to simulate a case about stirling engine, it is like the motion of piston,i write a udf to control the piston motion, but the result shows the pressure shakes and increases the pressure value.In normal situlation, the pressure should be shake on steady,the pressure can't always increase, who can help me to solve the problem, please!!! i had think is it my UDF wrong about the "force". can everyone help me!!!>"<I really need someone can help me !

it is my UDF #include <stdio.h> #include "udf.h" # define UDF_FILENAME "piston.dat" # define PI 3.141592654 # define rp 0.0067 # define l1 0.079 # define rpm 500. # define w 2.*PI*rpm/60. # define q w*time FILE *fp;

DEFINE_CG_MOTION(piston1, 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","a"); 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];

if (rp_axi)

force *= 2.0 * PI;

pressure = force / 0.0099*0.0099*PI; } end_f_loop (f, t)

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





Message ("\nUDF valve:%f,%f,%f,%f,%f,%f\n",time,loc,velo,dtime

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

v3,pressure); fclose (fp); }
vahid-karaj likes this.
  Reply With Quote
Sponsored Links

Old   May 28, 2014, 10:37
Default Question
New Member
Join Date: May 2014
Posts: 1
Rep Power: 0
genie2014mecanique is on a distinguished road
I used fluently with Visual Studio in the study of Stirling Engine
I have a problem when the engine speed decreases Increase heat spread
Knowing that I used the sinusoidal motion
genie2014mecanique is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CFX Piston Motion (CEL) Dante CFX 13 May 31, 2012 08:47
who can help me about my udf on piston... sweetcherry FLUENT 1 May 15, 2008 01:48
Mexican hat piston Amida Oluwole Main CFD Forum 0 June 12, 2007 06:12
Piston Motion A Student Siemens 0 April 18, 2006 11:36
piston motion Arpan Siemens 1 March 9, 2006 08:52

Sponsored Links

All times are GMT -4. The time now is 03:28.