|
[Sponsors] |
how to write UDF to define 2 profiles at inlet? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 1, 2003, 08:12 |
how to write UDF to define 2 profiles at inlet?
|
#1 |
Guest
Posts: n/a
|
Hi,all!
I want to give the velocity and at the same time pressure profile at inlet of a 2-D geometry. How can I write the right UDF? With which macro? Or is there any solution to this issue except UDF? Hope somebody can help me. Emma |
|
December 1, 2003, 09:07 |
Re: how to write UDF to define 2 profiles at inlet
|
#2 |
Guest
Posts: n/a
|
You can right a UDF to give a profile for velocity or pressure at the inlet and this is relativly simple. Are you sure you wish to specify both a pressure and velocity profile. It is normal pactice to specify either the velocity or the pressure at one boundary and get the code to calculate the result of the other variable. However, if you wish to set both and think you will obtian a physical result I would use a define profile for the velocity inlet and a define adjust to set the pressure, it would be something like this:
#include "udf.h" DEFINE_PROFILE(inlet_vel, thread, i) { face_t f; begin_f_loop(f, thread) { F_PROFILE(f, thread, i) = [function for the velocity inlet profile]; } end_f_loop(f, thread) } DEFINE_ADJUST(pressure, d) { face_t f; Thread *thread = Lookup_Thread(d, [inletID]); begin_f_loop(f, thread) { F_P(f, thread) = [function of Pressure]; } end_f_loop(f, thread) } I haven't checked or compiled it so have a play with it. |
|
December 2, 2003, 08:16 |
Re: how to write UDF to define 2 profiles at inlet
|
#3 |
Guest
Posts: n/a
|
Hi Andrew,
Thanks a lot for your helpful advice! I tried it with the DEFINE_ADJUST macro to define the pressure on inlet. It's successfully interpreted and also hooked. I defined the pressure as a sinusoidal signal, which has a frequency of 100 Hz and the average is about 100 bar. But when I checked the monitor-surface result of this pressure, it's not sinusoidal and the average value is only 16 bar. What did I set wrongly? Or is it really a very bad practice to set the velocity and the presure profiles at the same place? Regards, Emma |
|
December 2, 2003, 08:43 |
Re: how to write UDF to define 2 profiles at inlet
|
#4 |
Guest
Posts: n/a
|
This post was made recently:
http://www.cfd-online.com/Forum/fluent.cgi?read=16464 which explains it quite nicley. As for the problem with the UDF, is your problem time dependant, as you mention 100Hz, if so you may need extra terms in your UDF. |
|
December 4, 2003, 12:23 |
Re: how to write UDF to define 2 profiles at inlet
|
#5 |
Guest
Posts: n/a
|
hi emma,
I am considering if it is possible to create new boundary types in fluent. Since we can set three velocity components on a face, I think giving two velocity components and pressure on the boundary should be proper. However, what ap has said seems right and I am a little confused now. good luck. |
|
January 30, 2011, 06:22 |
define a surface or line source from FLUENT
|
#6 |
Member
CJ
Join Date: Jun 2009
Posts: 34
Rep Power: 17 |
looks fine
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 12:48 |
Help: using udf to define direction | Bo | FLUENT | 1 | July 16, 2008 07:47 |
Reaction Rate in UDF | mahdi | FLUENT | 2 | August 7, 2007 09:31 |
Urgent! Help on UDF to set inlet velocity | Ray Hong | FLUENT | 4 | December 30, 2005 13:32 |
How define porous media as INLET? | Harry Qiu | FLUENT | 2 | April 13, 2001 17:34 |