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

2 inlets, 2 UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2010, 05:28
Default 2 inlets, 2 UDF
  #1
New Member
 
bilalmerei
Join Date: Mar 2010
Posts: 14
Rep Power: 16
bilalmerei is on a distinguished road
plz i need an urgent help.
i have to inject oil into water.
the problem that water must have a specific profile of velocity so i have to introduce a UDF. and same for the oil.
so i don't know how to define 2 UDF and interpret them in each inlet.
plz help
bilalmerei is offline   Reply With Quote

Old   December 12, 2010, 13:26
Question UDF needed too
  #2
New Member
 
Rajat
Join Date: Dec 2010
Posts: 2
Rep Power: 0
rajat4416 is on a distinguished road
I too need udf function for a fully developed velocity profile at inlet in vertical channel . As i have never worked on Fluent i dont know how udf
have to write is it exactly the same code as in FORTRAN or C as i know
both well but udf i dont know
rajat4416 is offline   Reply With Quote

Old   December 12, 2010, 13:54
Default
  #3
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16
ComputerGuy is on a distinguished road
UDF's are User Defined Functions

They are typically written in C, but can be written in Fortran. Fluent has a C interpreter built in, so you don't need one unless aspects of the calculation (specific Fluent calls, speed of calculation, etc) require compilation.

To impose a fully developed profile at a wall, you must loop over all faces of the wall and set the velocity magnitude (or, perhaps, a vector component) equal to the velocity you obtain from fully developed flow.

In the code below, I assume the following:
1) Fully developed laminar flow
2) 2-D flow in the x-direction
3) An inlet face which extends from 0.5 to -0.5 in the y-direction
4) A maximum centerline velocity of 10

Code:
#include "udf.h"

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

  begin_f_loop(f, thread)
    {
      F_CENTROID(x,f,thread);
      y = x[1];
      F_PROFILE(f, thread, position) = 10.-10.*(y*y/(0.5*0.5));
    }
  end_f_loop(f, thread)
}
I haven't tested it, but it should function OK with few, if any, changes. I don't know which direction you've specified as vertical, so you'll need to adapt a few things in the code above to fit your application.

Go here: http://combust.hit.edu.cn:8080/fluen.../udf/node2.htm
for more information on UDFs.

ComputerGuy
ComputerGuy is offline   Reply With Quote

Old   December 13, 2010, 02:04
Smile Thanks
  #4
New Member
 
Rajat
Join Date: Dec 2010
Posts: 2
Rep Power: 0
rajat4416 is on a distinguished road
many thanks to ComputerGuy for you help and code I will try to learn and do whatever is needed furthermore.
rajat4416 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
udf for velocity profile in a geometry having two inlets shubham208011 Fluent UDF and Scheme Programming 0 April 6, 2009 15:13
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 20:38.