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

UDF PROBLEM

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 16, 2007, 06:23
Default UDF PROBLEM
  #1
anant
Guest
 
Posts: n/a
Hi everybody, I have a 2 D model in which I am using a UDF to give motion to a body(named valve) which inturn is immersed in a control volume. The model is like this. A rectangular object(valve) is placed inside another rectangular control volume. the valve is expected to move up in the Y direction while the flow is on.

Bdry conditions are : inlet--- mass flow inlet outlet---pressure outlet valve--- waLL (with the option moving wall enabled in the dynamic zone panel)

I am modelling it as a dynamic mesh problem and am using the following UDF,

#include "udf.h"

static real v_prev = 0.0;

DEFINE_CG_MOTION(piston, 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 / 50.0; v_prev += dv; Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force);

/* set y-component of velocity */ vel[1] = v_prev; }

I create ONLY the valve as the "Dynamic zone".

After the udf is compiled and the ITERATIONS initiated in an unsteady flow, the vlave DOES'T MOVE. i am doing problem to ascertain the changes in the flow var as the valve moves up in the Y direction. I am unable to identify the error . can some one help .

thanks .
  Reply With Quote

Old   January 16, 2007, 10:36
Default Re: UDF PROBLEM
  #2
Venkatesh V
Guest
 
Posts: n/a
I hope Fluent did correct by not moving the valve. You are assigning v_prev to Y Velocity i.e vel[1].

But in the starting of the code you have initialized v_prev to zero and you have not changed to some number after that.

If your objective is to only move the valve in y direction, no need to use UDF you can jut input these parameters in Dynamic Mesh control panel.

I hope this would help you.

Thanks Venkatesh V
  Reply With Quote

Old   January 17, 2007, 01:15
Default Re: UDF PROBLEM
  #3
anant
Guest
 
Posts: n/a
THANKS VENKATESH FOR A QUICK REPLY,

I am an not very conversant with UDF, however can you please explain how do I go about giving "motion" to the valve by entering the parameters in the Dynamic Mesh control panel. where do I enter the values of the motion ? Is there any tutorial problem rewgarding this ? regards Ananth
  Reply With Quote

Reply

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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 01:31
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


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