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

Fluent UDF help!!!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2010, 18:37
Default Fluent UDF help!!!
  #1
New Member
 
Join Date: Mar 2010
Posts: 1
Rep Power: 0
fluentuser is on a distinguished road
Hi everyone

I am trying to model a moving sphere in hypersonic flow. I want the sphere to move according to the forces in experiences due to the incoming flow. It is a 2D axis symmetric case and hence i want the sphere to move in only one direction, basically 1 DOF motion. Below is my UDF, it complies alright, but when i try to run it fluent gives me a segmentation violation error, i am only defining my sphere as a rigid body in the zones with the UDF and have not defined anything else, i am using the smoothing parameter for my dynamic mesh. Any help will be much appreciated

#include "udf.h"
static real v_prev = 0.0;

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

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

if (!Data_Valid_P())
return;

/* get the thread pointer for which this motion is defined */
t = DT_THREAD(dt);

/* compute pressure force on body by looping through all faces */
force = 0.0;
begin_f_loop(f,t)
{
F_AREA(A,f,t);
force += F_P(f,t) * NV_MAG(A);
}
end_f_loop(f,t)

/* compute change in velocity, i.e., dv = F * dt / mass
velocity update using explicit Euler formula */
dv = dtime * force / .000756;
v_prev += dv;
Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev,
force);

/* set x-component of velocity */
vel[0] = v_prev;
}
fluentuser is offline   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
Using Fluent with a UDF frm a remote m/c aarti FLUENT 2 September 11, 2008 19:53
problem loading UDF in parallel fluent Tim FLUENT 12 July 12, 2008 12:59
HELP! Fluent UDF Iterate error Sam FLUENT 2 July 10, 2008 21:29
UDF problem caused by various version of Fluent Yurong FLUENT 3 January 15, 2006 10:57
Can somebody send me a Fluent 6 UDF manual?? KKLAU FLUENT 4 April 14, 2004 16:37


All times are GMT -4. The time now is 12:04.