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

UDF for 3-Dimensional geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 1, 2004, 01:49
Default UDF for 3-Dimensional geometry
  #1
vimal
Guest
 
Posts: n/a
I want to write a UDF for parabolic velocity proifles for flow in a 3-Dimensional pipe. Can any one suggest me.
  Reply With Quote

Old   January 2, 2004, 16:26
Default Re: UDF for 3-Dimensional geometry
  #2
ap
Guest
 
Posts: n/a
It's just the same as in 2D. Write the equation of the paraboloid which represents your profile.

Suppose your flow is oriented along the z axiz. Center the inlet with the origin of your reference system. Your profile will assume the simple form:

z = a*x^2 + b*y^2 + c

Use the macro F_CENTROID to retrieve the cell centroid coordinates, with a line like the following:

F_CENTROID(x,f,t);

where x is an array of dimension ND_ND, f is the face and t the thread. Then, you can put

x = x[0];

y = x[1];

and use

F_PROFILE(f, t, i) = a*pow(x,2) + b*pow(y,2) + c;

replacing a, b and c with their values.

Hi

ap
  Reply With Quote

Old   January 5, 2004, 13:09
Default Re: UDF for 3-Dimensional geometry
  #3
co2
Guest
 
Posts: n/a
ap,

why do you put Hi

at the end of your message?
  Reply With Quote

Old   January 8, 2004, 10:09
Default Re: UDF for 3-Dimensional geometry
  #4
ap
Guest
 
Posts: n/a
Just a nice and short way to say "Hello and good work". A smile always helps.

Hi

ap
  Reply With Quote

Old   January 8, 2004, 14:50
Default Re: UDF for 3-Dimensional geometry
  #5
hatta
Guest
 
Posts: n/a
Hi everyone,

Suppose i am using the velocity at the inlet of the st. pipe is 0.45 m/s. The ID of the tube is 0.0102 m, by using these values i made a UDF for 3D as

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y,z; face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

y = x[0];

z = x[1]; F_PROFILE(f,thread,position)=0.45-y*y/(.0051*.0051)*0.45-z*z/(.0051*.0051)*0.45;

} end_f_loop(f, thread) }

when is read the velocity at the inlet of the tube it shows 2400 m/s. there is somthing wrong, can you please suggest me what is wrong here.
  Reply With Quote

Old   January 8, 2004, 18:51
Default Re: UDF for 3-Dimensional geometry
  #6
ap
Guest
 
Posts: n/a
If your velocity profile is function of y and z coordinates, these two lines are wrong:

y = x[0];

z = x[1];

The x vector contains in the order x,y,z coordinates. So:

x[0] -> x coordinate

x[1] -> y coordinate

x[2] -> z coordinate

To check the paraboloid equation, just plot it in a softwnare like gnuplot.

Hi

ap
  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
Help Parallelizing UDF AndresC FLUENT 0 February 25, 2010 15:50
Simulation of Flow through Complex 3D Geometry EmersonKB CFX 5 July 2, 2009 08:17
udf for velocity profile in a geometry having two inlets shubham208011 Fluent UDF and Scheme Programming 0 April 6, 2009 15:13
UDF macros and updated mesh geometry Maziar Mahzari FLUENT 1 November 1, 2005 06:29
UDF : Chemical Reaction in Catalytic Converter adhimac FLUENT 1 March 27, 2001 14:04


All times are GMT -4. The time now is 23:02.