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

DEFINE_CG_MOTION and pressure force

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2008, 11:25
Default DEFINE_CG_MOTION and pressure force
  #1
Teo Fumagalli
Guest
 
Posts: n/a
Hello, I want to model a closed channel in 2D with left and right walls moving with a sine function velocity. In the middle of channel there is a rigid body which is supposed to move because of the force exercised by the pressure on its walls. I wrote udf for the walls using DEFINE_CG_MOTION macro and it works fine. I wrote also a udf for the rigid body always with DEFINE_CG_MOTION macro, but it doesn't work. As soon the simulation starts it gives a segmentation violation error. The remeshing strategy is correct, probably the error is in the udf. Can anyone help me to find the mistake if there is one? (After the pressure force is computed, shear force is subtracted. To get the axial velocity I used the drag friction force, because the rigid body should mimic a bubble of air._ Thank you

/************************************************** ********** * 1-degree of freedom equation of motion (x-direction) * compiled UDF ************************************************** **********/ #include "udf.h" static real v_prev = 0.0; static real force = 0.0;

DEFINE_CG_MOTION(drag,dt,vel,omega,time,dtime) { face_t f; Thread *t; real NV_VEC(A);

/* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0);

if (!Data_Valid_P())

return;

/* compute pressure force on body by looping through all faces */ /* subtract to the presure force the wall shear force */ begin_f_loop(f,t)

{

F_AREA(A,f,t);

force += F_P(f,t) * A[0]+ F_STORAGE_R_N3V(f,t,SV_WALL_SHEAR)[0];

} end_f_loop(f,t)

/* considering the rigid body a bubble of gas with no mass*/ /* velocity is computed according to the friction drag force F=1/2*rho*Cd*A*u^2 */ /* velocity = force / (6*viscosity* radius) */ /* 0.001 = viscosity, 0.000014 = radius */

v_prev = force/(6*3.412*0.001*0.000014);

/* set x-component of velocity */ vel[0] = v_prev;

  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
DEFINE_CG_MOTION s FLUENT 4 November 24, 2010 21:59
pressure force and viscous force CFD FLUENT 0 March 7, 2006 02:03
Pressure force shyam FLUENT 5 June 5, 2005 06:40
Calculate Pressure force andreis FLUENT 0 May 16, 2005 06:40
UDS: DEFINE_CG_MOTION luca FLUENT 0 November 25, 2004 09:46


All times are GMT -4. The time now is 14:54.